【发布时间】:2020-01-10 19:58:17
【问题描述】:
我正在尝试在 windows 2012R2 中运行 powershell 脚本 5.1 版
powershell 命令控制台上的powershell.exe -NoProfile D:\test2.ps1(我不使用系统上的任何配置文件进行脚本会话)
现在我在 test.ps1 脚本中检查 test.ps1 脚本中加载了哪些配置文件
$个人资料
我得到输出 C:\Users\XXXXX\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
任何个人资料在我的会话中启动的任何想法。
【问题讨论】:
-
我的理解是
$Profile列出了将加载的,而不是已加载的。请记住,它会列出一个不存在的文件。 [咧嘴]
标签: powershell external profile