【发布时间】:2020-05-23 22:55:50
【问题描述】:
在 vscode 中使用 PowerShell 5.1。我的系统上有很多 profile.ps1 文件。
【问题讨论】:
-
这可能会启发你 ;-) Understanding the Six PowerShell Profiles.
标签: powershell visual-studio-code
在 vscode 中使用 PowerShell 5.1。我的系统上有很多 profile.ps1 文件。
【问题讨论】:
标签: powershell visual-studio-code
要知道您的个人资料应该在哪里,您可以简单地查询$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"
}
【讨论】:
New-Item $PROFILE