我想移動我的默認「我的文檔\ WindowsPowerShell」文件夾。但是,當我嘗試這個時,PowerShell當然找不到$ profile。是否有文件或我可以編輯的內容將PowerShell指向另一個啓動文件夾?
回答
我可以建議是,你點源具有文件$profile.AllUsersAllHosts
$profile.AllUsersAllHosts
在您的個人資料的內容的文件是一樣的東西C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
相關問題:Is it possible to change the default value of $profile to a new value?
嗯,我沒有這個名字的文件。應該有一個?有一個名爲'examples'的文件夾,其中有一個profile.ps1。 –
@charles Anderson您將不得不創建。就我所知,沒有一個配置文件是最初創建的。只要執行'New-Item -path $ profile.AllUsersAllHosts -type file -force' ' – manojlds
至於我知道你不能那樣做。用戶配置文件位置始終位於「我的文檔\ WindowsPowerShell」下,唯一的選擇是重新定位文檔文件夾(文件夾重定向)。
您可以使用Sysinternals的junction.exe使WindowsPowershell
目錄成爲另一個位置(但不是網絡驅動器)的符號鏈接。
你可以這樣做,如果你想在C:\POSH
junction.exe "$HOME\Documents\WindowsPowerShell" 'C:\POSH'
我正在使用這個沒有問題。我使用Powershell社區擴展PSCX cmdlet new-symlink來做同樣的事情。 – jhamm
注意,連接和[Windows 10符號鏈接](https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/#w22Irqj0V76jeb9w.97)是不同的。 –
存儲配置文件腳本默認情況下$Profile/$Home/$PSModulePath
都在註冊表中......通常在
HKEY_CURRENT_USER\Volatile Environment
用戶環境變量HKEY_CURRENT_USER\Environment
用於系統環境變量HKEY_CURRENT_USER\Software\Microsoft\Windows\Explorer\User Shell Folders
和其他地方!
- 1. 如何在/ etc/profile設置ENV變量?
- 2. 如何設置XAMPP以使用Windows PowerShell?
- 3. 在Windows PowerShell中爲GCC設置別名
- 4. Powershell設置GPO
- 5. Powershell Profile腳本點源?
- 6. 使用Powershell更改Windows更新設置
- 7. PowerShell設置要在
- 8. 如何在Powershell或Windows命令Shell中設置FAT32短名稱
- 9. 如何在Powershell中設置FromFile位置?
- 10. Powershell的$ profile模擬用於常規Windows命令行(cmd.exe)
- 11. 我如何處置System.Xml.XmlWriter在PowerShell中
- 12. 在powershell中實際設置IIS設置
- 13. Powershell COM +設置
- 14. 如何在Liberty Profile中設置wlp.password.encryption.key的值
- 15. 如何在IntelliJ中設置spring active profile環境變量
- 16. 如何在/ etc/profile中設置R環境?
- 17. powershell - 如何設置屬性
- 18. 如何使用PowerShell設置TimeZone
- 19. PowerShell的代理設置
- 20. 如何在Windows XP上設置Windows SDK
- 21. 如何從Powershell設置Windows服務權限?
- 22. Powershell或命令行在Windows 8.1上設置壁紙?
- 23. 在Windows窗體中設置變量powershell textinput VB
- 24. Powershell:在Windows 8虛擬機中設置屏幕分辨率
- 25. 如何使用PowerShell在Windows 8中打開Windows位置平臺
- 26. Maven未能在Windows上啓動Liberty Profile
- 27. Powershell重置Windows更新
- 28. 設置使用PowerShell
- 29. 如何在Windows服務中設置.NET UnhandledException處理?
- 30. Windows在何處存儲「計劃任務」控制檯的設置?
爲什麼不只是在普通的配置文件中點源文件? – EBGreen
因爲我想移動整個WindowsPowerShell文件夾。但是,如果這是不可能的,你的建議將是完美的妥協。 –