[英]Unable to execute PowerShell Script using 'Run with Powershell' option
[英]Unable to execute PowerShell Script
如何使我的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
Technet上的這篇文章建議嘗試使用Get-ExecutionPolicy
來檢查腳本執行策略,然后將其設置為AllSigned
或Unrestricted
。 另外,請確保您像這樣運行腳本".\\scriptname.ps1"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.