Symptoms: windows-install.ps1 script fails to run
Error messages observed during installation:
- windows-install.ps1 is not digitally signed.
- You cannot run this script on the current system.
- SecurityError / PSSecurityException / UnauthorizedAccess
Root Cause:
Windows provides a feature for disabling the execution of PS1 scripts, and some IT administrators enable this feature for enhanced security.
See more about Execution_Policies.
Solution:
- Identify the current execution policy.
Get-ExecutionPolicy -List
Scope Execution Policy MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser Undefined LocalMachine RemoteSigned (or Undefined) Typically the problem is the LocalMachine setting. If it is set to 'RemoteSigned' or 'Undefined' then scripts cannot be executed.
- Change the policy to 'Unrestricted': Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine
Once the Data Connector is operational, you can restore the original execution policy if you wish.
- Change policy back: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
- Verify the policy was restored: Get-ExecutionPolicy -List