Fundamental concepts for PowerShell scripting
Set ExecutionPolicy on the Server
Setting
Unrestricted
No requirements; all scripts allowed
RemoteSigned
All local scripts allowed; only signed remote scripts
AllSigned
All scripts need to be signed
Restricted
No scripts allowed (Scripts won't run.)
You can set PowerShell's execution policy by using the following cmdlet:
Set-ExecutionPolicy
e.g. Set-ExecutionPolicy Unrestricted
A PowerShell script is really nothing more than a simple text file.
The file contains a series of PowerShell commands, with each command appearing on a separate line.
For the text file to be treated as a PowerShell script, its filename needs to use the .PS1 extension.