From 2cee56af4e1664580d1fd09c1c5065f7c3582422 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 20 Mar 2025 07:01:46 -0700 Subject: [PATCH] Set bypass executionpolicy when calling PowerShell --- powershell-adapter/powershell.dsc.resource.json | 12 ++++++++++++ .../windowspowershell.dsc.resource.json | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/powershell-adapter/powershell.dsc.resource.json b/powershell-adapter/powershell.dsc.resource.json index 76cb1a124..7a4bcb3db 100644 --- a/powershell-adapter/powershell.dsc.resource.json +++ b/powershell-adapter/powershell.dsc.resource.json @@ -14,6 +14,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "./psDscAdapter/powershell.resource.ps1 List" ] @@ -26,6 +28,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Get" ], @@ -37,6 +41,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Set" ], @@ -50,6 +56,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Test" ], @@ -62,6 +70,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Export" ], @@ -74,6 +84,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Validate" ], diff --git a/powershell-adapter/windowspowershell.dsc.resource.json b/powershell-adapter/windowspowershell.dsc.resource.json index 54f91a9d2..a85845f41 100644 --- a/powershell-adapter/windowspowershell.dsc.resource.json +++ b/powershell-adapter/windowspowershell.dsc.resource.json @@ -14,6 +14,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "./psDscAdapter/powershell.resource.ps1 List" ] @@ -26,6 +28,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Get" ], @@ -37,6 +41,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Set" ], @@ -50,6 +56,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Test" ], @@ -62,6 +70,8 @@ "-NoLogo", "-NonInteractive", "-NoProfile", + "-ExecutionPolicy", + "Bypass", "-Command", "$Input | ./psDscAdapter/powershell.resource.ps1 Validate" ]