Skip to content

Commit 9afe8e5

Browse files
committed
Adding in execution policy update
1 parent d1e8a0a commit 9afe8e5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

setup/azurecmd.wxs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
NOT VersionNT64
4040
</SetProperty>
4141

42+
<SetProperty Id="POWERSHELLEXE" Value="[WindowsFolder]System32\WindowsPowerShell\v1.0\powershell.exe" Before="AppSearch"/>
43+
4244
<Property Id="POWERSHELLGETMODULESINSTALLED" >
4345
<DirectorySearch Id="PROGRAMFILESCONTAINER" Path="[BaseModulesFolder]">
4446
<DirectorySearch Id= "PROFILEMODULE" Path="AzureRM.Profile"/>
@@ -114,10 +116,12 @@
114116
<CustomAction Id="UpdatePSShortcut" BinaryKey="CustomActions" DllEntry="UpdatePSShortcut" Execute ="deferred" Impersonate="no"/>
115117
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="UpdatePSShortcut"
116118
Value="ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
119+
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;Set-ExecutionPolicy RemoteSigned -Scope LocalMachine -Force&quot;" Execute="deferred" Impersonate="no" Return="check"/>
117120

118121
<InstallExecuteSequence>
119122
<Custom Action="SetCustomActionDataValue" After="CreateShortcuts">NOT Installed</Custom>
120123
<Custom Action="UpdatePSShortcut" After="SetCustomActionDataValue">NOT Installed</Custom>
124+
<Custom Action="SetExecutionPolicy" After="UpdatePSShortcut">NOT Installed</Custom>
121125
</InstallExecuteSequence>
122126

123127
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProjectDir)\media\License.rtf" />

0 commit comments

Comments
 (0)