PowerShell Execution Policy (High Availability)
Error Message
Incorrect function
Description
The Quali High Availability (HA) solution uses PowerShell code to manage the cluster.
The error message occurs in an HA deployment where PowerShell scripts are used to manage the cluster.
If, after starting the Quali Server role from the Windows Failover Cluster Manager, the role fails with an ‘incorrect function’ error, run the steps below.
This error can be found both in the Windows Failover Cluster Manager and in the Windows Event Viewer.
Solution
Follow these steps to ensure that the execution policy is unrestricted on the machine where the code is executed:
-
Open PowerShell as Administrator.
-
Run the following command:
Get-ExecutionPolicy
.The command should return the result: Unrestricted.
-
If this result is not received, run the following command:
Set-ExecutionPolicy Unrestricted
-
In the registry, make sure that the following key value is unrestricted:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
-
Restart the Quali Server role.
-
If you're still not getting the Unrestricted result, run:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser