簡體   English   中英

無法執行PowerShell腳本

[英]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來檢查腳本執行策略,然后將其設置為AllSignedUnrestricted 另外,請確保您像這樣運行腳本".\\scriptname.ps1"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM