0
如何讓我的PowerShell腳本執行?無法執行PowerShell腳本
當我運行我的腳本,我得到的錯誤:
File cannot be loaded because the execution of scripts is disabled on this system
你能幫我把我的腳本來運行?
set-executionpolicy unrestricted
#Set-ExecutionPolicy RemoteSigned
$target=[IO.File]::ReadAllText(".\usermenuTest1.4d")
$output=[IO.File]::ReadAllText(".\usermenuTest2.4d")
($output -replace $target) | Set-Content "usermenuTest2.4d.new"
Start-Sleep -s 10
RemoteSigned是ExecutionPolicy的另一個廣泛使用的值。 – 2013-05-01 03:45:36
'&powershell.exe -executionpolicy bypass -file C:\ script.ps1'完全忽略執行策略。 – 2013-05-01 04:46:07
您也可以使用Set-ExecutionPolicy Unrestricted -Scope Process -Force暫時解決它而不更改系統默認值 – 2013-05-01 12:06:04