Sense June 2018 setup fails dues to Constrained Language mode setting of Powershell
Article Number: 000056729 | Last Modified: 2019/11/21
Installation or upgrade of Qlik Sense June 2018 fails with the following error in Service Dispacther log:
CAQuietExec: "powershell" -NoLogo -NonInteractive CAQuietExec: Add-Type : Cannot add type. Definition of new types is not supported in this CAQuietExec: language mode. CAQuietExec: At D:\Qlik\Sense\AppDistributionService\install-utils\Security.ps1:2 char:5 CAQuietExec: + Add-Type -AssemblyName System.Security CAQuietExec: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CAQuietExec: + CategoryInfo : PermissionDenied: (:) , PSNotSupported CAQuietExec: Exception CAQuietExec: + FullyQualifiedErrorId : CannotDefineNewType,Microsoft.PowerShell.Command CAQuietExec: s.AddTypeCommand CAQuietExec: CAQuietExec: Error 0x80070001: Command line returned an error. CAQuietExec: Error 0x80070001: QuietExec Failed CAQuietExec: Error 0x80070001: Failed in ExecCommon method CustomAction CA_SetupADS returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Add-Type : Cannot add type. Definition of new types is not supported in this language mode.
In one of the cases, company's group policy was set to have powershell in constrained language mode. This restricts Qlik Sense install to execute powershell commands.
Disclaimer: This is an undocumented system environment variable from Microsoft, if you do the modification it would be on your own risk.
Create a new System Environment variable named __PSLockDownPolicy and set the value to 0. This will put powershell in FULL language mode.