我想移动我的默认“我的文档\ 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文件夹。但是,如果这是不可能的,你的建议将是完美的妥协。 –