[英]Running a powershell .ps1 script without loading any profile
我正在嘗試在 Windows 2012R2 中運行 powershell 腳本版本 5.1
powershell.exe -NoProfile D:\\test2.ps1 在 powershell 命令控制台(我不使用系統上的任何配置文件的腳本會話)
$profile
我得到輸出C:\\Users\\XXXXX\\Documents\\WindowsPowerShell\\Microsoft.PowerShell_profile.ps1
任何想法為什么在我的會話中啟動任何配置文件。
配置文件未加載,因為您在powershell.exe
上指定了-NoProfile
。 但是,仍然定義了$profile
變量。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.