Troubleshoot your Script Permissions

Symptoms: windows-install.ps1 script fails to run

Error messages observed during installation:

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:

  1. 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.

  2. 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.

  1. Change policy back: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
  2. Verify the policy was restored: Get-ExecutionPolicy -List