如何查找PowerShell集成控制台使用的profile.ps1文件?
在vscode中使用PowerShell 5.1。我的系统上有很多profile.ps1文件。要知道您的配置文件应该在哪里,您只需查询$profile变量:如何查找PowerShell集成控制台使用的profile.ps1文件?,powershell,visual-studio-code,Powershell,Visual Studio Code,在vscode中使用PowerShell 5.1。我的系统上有很多profile.ps1文件。要知道您的配置文件应该在哪里,您只需查询$profile变量: > $profile > # It might not exist. Then you can just create it > if (!(Test-Path $profile)) { Write-Host 'Hello from your new profile' > $profile;
> $profile
> # It might not exist. Then you can just create it
> if (!(Test-Path $profile)) {
Write-Host 'Hello from your new profile' > $profile;
"Profile file created in $profile"
}
要知道您的配置文件应该在哪里,您只需查询$profile变量:
> $profile
> # It might not exist. Then you can just create it
> if (!(Test-Path $profile)) {
Write-Host 'Hello from your new profile' > $profile;
"Profile file created in $profile"
}
这可能会启发你;-。这可能会启发你;-。或者只是一个新项目$PROFILE@Carlos加西亚,我相信这对你来说是个简单的答案,但我花了好几个小时来确定颜色是从哪里来的。部分原因是我已经为5.1、7、7.1进行了大量的测试安装。以及在本地安装的努力。谢谢你的帮助,卡洛斯@schuelermine你的答案很好,当然也赢得了Ockhem剃须刀测试,但毕竟我一直在努力将这一点确定下来,Carlos给出的令人安心的闭环得到了答案。或者只是一个新项目$PROFILE@Carlos加西亚,我相信这对你来说是一个简单的答案,但我已经花了几个小时试图确定答案在哪里颜色是从哪里来的。部分原因是我已经为5.1、7、7.1进行了大量的测试安装。以及在本地安装的努力。谢谢你的帮助,卡洛斯@schuelermine你的回答很好,当然赢得了Ockhem剃须刀测试,但毕竟我一直在努力把这个问题解决,Carlos给出的令人放心的闭环得到了答案。