本文主要是对微软官方文档中,关于$PROFILE
的内容,进行简单整理。
https://learn.microsoft.com/zh-cn/powershell/scripting/learn/shell/creating-profiles
https://learn.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_profiles
$PROFILE
变量,默认返回的是当前用户,当前主机的配置文件的路径。
1 | $PROFILE |
1 | $PROFILE | Select-Object * |
首次安装 PowerShell 时,配置文件是不存在的,可以使用以下的命令来创建。
1 | if (!(Test-Path -Path $PROFILE)) { |
1 | notepad $PROFILE |
说些什么吧!