xxxxxxxxxx
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
xxxxxxxxxx
Set-ExecutionPolicy RemoteSigned # to set the policy to RemoteSigned.
Set-ExecutionPolicy Unrestricted # to set the policy to Unrestricted.
Get-ExecutionPolicy # to verify the current settings for the execution policy.
xxxxxxxxxx
Set-ExecutionPolicy -ExecutionPolicy <PolicyName>
#Example:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
#To set the execution policy in a particular scope:
Set-ExecutionPolicy -ExecutionPolicy <PolicyName> -Scope <scope>
#Example:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
xxxxxxxxxx
# To bypass the execution policy for a single file, inside powershell type>
powershell -ExecutionPolicy Bypass -File <insert script filename here>
xxxxxxxxxx
Set-ExecutionPolicy -ExecutionPolicy <PolicyName> # general syntax
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned # for example
xxxxxxxxxx
# To bypass the execution policy for a single file, inside powershell type>
powershell -ExecutionPolicy Bypass -File <insert script filename here>