Introduction
When installing the Cireson Portal you may get errors in the installation log that a PowerShell command was not able to run because a command was not recognized. For example:
The term 'Invoke-Sqlcmd' is not recognized as the name of a cmdlet, function, script file, or operable program.
This is often the result of a policy either locally on the computer or from a group policy object the prevents executing a PowerShell script that is not properly signed.
This article describes how to temporarily change the script execution policy to allow the installer to successfully execute the necessary PowerShell commands to install the portal.
Changing the Local Policy
Open a PowerShell prompt as an elevated administrator.
Run this command:
Get-ExecutionPolicy
This will result in one of three levels (from least restrictive to most restrictive):
- Unrestricted
- RemoteSigned
- AllSigned
Make a note of the current policy level so that you can set it back to the original policy after the installation is run. If the policy level is currently something other than Unrestricted run this command:
Set-ExecutionPolicy Unrestricted
Run the Cireson Portal installer.
After the installation is completed set the policy back to the original value by running this command:
Set-ExecutionPolicy
Example:
Set-ExecutionPolicy AllSigned
Changing the Group Policy Object
In some cases you may not be able to change the policy locally because the computer is the target of a group policy object that sets the execution policy. In this case you will need to change the group policy object to exclude the computer you are trying to install on temporarily.Â
- Open the Group Policy Management MMC snapin.
- Find the Group Policy that is applying the execution policy and select it.
- Select the Delegation tab.
- Click the Advanced... button.
- Click Add...
- Click Object Types...
- Check the Computers box if it is not already checked and click OK.
- Search for the computer you want to exclude temporarily and click OK.
- Make sure the computer is selected in the Group or user names box.
- In the permissions box at the bottom check the box in the Deny column next to Apply group policy.
- Click OK
- Login to the computer where you will be doing the installation.
- Open a cmd prompt as an elevated administrator.
- Run the following command:
- gpupdate /force
- Wait for the group policy update to complete.
- Install the Cireson Portal.
- Return to the group policy configuration and remove the computer from the group or user names list.
- Run gpupdate /force again.
Â