From e6c9978ac2c4f9f739f2c62b3a896ab38fb93ced Mon Sep 17 00:00:00 2001 From: Marco Mansi Date: Wed, 25 Mar 2020 13:17:38 +0100 Subject: [PATCH 1/3] Set the execution policy in Packar to RemoteSigned Match the same ExecutioPolicy as in the Install-ServiceFabricSDK --- images/win/Windows2016-Azure.json | 3 ++- images/win/Windows2019-Azure.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index e0bf37f50..993e1b18a 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -238,7 +238,8 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" - ] + ], + "execution_policy": "remotesigned" }, { "type": "windows-restart", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 3ebbea245..4bae85793 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -219,7 +219,8 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" - ] + ], + "execution_policy": "remotesigned" }, { "type": "windows-restart", From 70c2ad2317d435fb2db72b6689540c7608d9096b Mon Sep 17 00:00:00 2001 From: Marco Mansi Date: Thu, 26 Mar 2020 16:20:08 +0100 Subject: [PATCH 2/3] Removed Set-ExecutionPolicy RemoteSigned from Install-ServiceFabricSDK.ps1 --- images/win/Windows2016-Azure.json | 3 +-- images/win/Windows2019-Azure.json | 3 +-- images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 993e1b18a..e0bf37f50 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -238,8 +238,7 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" - ], - "execution_policy": "remotesigned" + ] }, { "type": "windows-restart", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 4bae85793..3ebbea245 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -219,8 +219,7 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" - ], - "execution_policy": "remotesigned" + ] }, { "type": "windows-restart", diff --git a/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 b/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 index 25a0429db..b8e264a09 100644 --- a/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 +++ b/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 @@ -8,6 +8,4 @@ $temp_install_dir = 'C:\Windows\Installer' New-Item -Path $temp_install_dir -ItemType Directory -Force -Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force - WebpiCmd.exe /Install /Products:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEula /XML:https://webpifeed.blob.core.windows.net/webpifeed/5.1/WebProductList.xml From af3ba77937c4aeb53e6f1889af45af63308f0203 Mon Sep 17 00:00:00 2001 From: Marco Mansi Date: Thu, 26 Mar 2020 16:20:08 +0100 Subject: [PATCH 3/3] Revert "Removed Set-ExecutionPolicy RemoteSigned from Install-ServiceFabricSDK.ps1" This reverts commit 70c2ad2317d435fb2db72b6689540c7608d9096b. --- images/win/Windows2016-Azure.json | 3 ++- images/win/Windows2019-Azure.json | 3 ++- images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index e0bf37f50..993e1b18a 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -238,7 +238,8 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" - ] + ], + "execution_policy": "remotesigned" }, { "type": "windows-restart", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 3ebbea245..4bae85793 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -219,7 +219,8 @@ "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Install-ServiceFabricSDK.ps1" - ] + ], + "execution_policy": "remotesigned" }, { "type": "windows-restart", diff --git a/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 b/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 index b8e264a09..25a0429db 100644 --- a/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 +++ b/images/win/scripts/Installers/Install-ServiceFabricSDK.ps1 @@ -8,4 +8,6 @@ $temp_install_dir = 'C:\Windows\Installer' New-Item -Path $temp_install_dir -ItemType Directory -Force +Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force + WebpiCmd.exe /Install /Products:MicrosoftAzure-ServiceFabric-CoreSDK /AcceptEula /XML:https://webpifeed.blob.core.windows.net/webpifeed/5.1/WebProductList.xml