Skip to content

Commit 0083736

Browse files
committed
Fixing policy script
1 parent bceaad1 commit 0083736

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

setup/Setup/SetExecutionPolicy.ps1

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
# limitations under the License.
1313
# ----------------------------------------------------------------------------------
1414

15-
Get-ExecutionPolicy -List | Where-Object {$_.ExecutionPolicy -eq "Restricted"} |
16-
% {
17-
try
18-
{
19-
Set-ExecutionPolicy -Scope $_.Scope -ExecutionPolicy RemoteSigned -Force -ErrorAction "SilentlyContinue"
20-
}
21-
catch
22-
{
23-
# do not fail if execution policy cannot be set for this scope
24-
}
15+
16+
try
17+
{
18+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force -ErrorAction "SilentlyContinue"
19+
}
20+
catch
21+
{
22+
# do not fail if execution policy cannot be set for this scope
2523
}
24+

setup/azurecmd.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<CustomAction Id="UpdatePSShortcut" BinaryKey="CustomActions" DllEntry="UpdatePSShortcut" Execute ="deferred" Impersonate="no"/>
124124
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="UpdatePSShortcut"
125125
Value="ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
126-
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -ExecutionPolicy Bypass -Command &quot;.\&quot;[PowerShellFolder]\SetExecutionPolicy.ps1&quot;&quot;" Execute="deferred" Impersonate="no" Return="check"/>
126+
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -ExecutionPolicy Bypass -Command &quot;&quot;[PowerShellFolder]SetExecutionPolicy.ps1&quot;&quot;" Execute="deferred" Impersonate="no" Return="check"/>
127127

128128
<InstallExecuteSequence>
129129
<Custom Action="SetCustomActionDataValue" After="CreateShortcuts">NOT Installed</Custom>

0 commit comments

Comments
 (0)