prohibit running win10 powershell script to solve

win10 is now the default policy is Restricted

Under this policy is disabled by running the script file in the terminal, so we want to run our script file through powershell, then we need to change its strategy for the job, the following command can help you

# View the current execution policy
get-executionpolicy

# Change the execution policy to RemoteSigned
Set-ExecutionPolicy RemoteSigned

Then try again? Not work, then re-open like a powershell

 

Details on the implementation of the policy can see the official documents  https://docs.microsoft.com/zh-cn/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-6

Guess you like

Origin www.cnblogs.com/YMaster/p/11809629.html