Windows PowerShell 在哪里设置 $profile? [英] Where does Windows PowerShell set $profile?

查看:35
本文介绍了Windows PowerShell 在哪里设置 $profile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想移动我的默认我的文档\WindowsPowerShell"文件夹.但是,当我尝试这样做时,PowerShell 当然找不到 $profile.是否有我可以编辑的文件或其他内容以将 PowerShell 指向不同的启动文件夹?

解决方案

我可以建议您在 $profile.AllUsersAllHosts>

$profile.AllUsersAllHosts 类似于 C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1

相关问题:是否可以将 $profile 的默认值更改为新值?

I would like to move my default "My Documents\WindowsPowerShell" folder. However, when I try this, PowerShell of course can't find $profile. Is there a file or something that I can edit to point PowerShell to a different startup folder?

解决方案

What I can suggest is that you dot source the file having the content of your profile in the file $profile.AllUsersAllHosts

$profile.AllUsersAllHosts is something like C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1

Related question: Is it possible to change the default value of $profile to a new value?

这篇关于Windows PowerShell 在哪里设置 $profile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆