From 812a485d78ad5d0e294e53d43c3bc16878528bde Mon Sep 17 00:00:00 2001 From: Alexander Nabokikh Date: Sun, 14 Aug 2022 18:47:58 +0200 Subject: [PATCH] feat(setup.ps1): added powershell execution policy setup step --- setup.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.ps1 b/setup.ps1 index 9db25d6..68eecc4 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -1,3 +1,13 @@ +# Ensure PowerShell execution policy is set to RemoteSigned for the current user +$ExecutionPolicy = Get-ExecutionPolicy -Scope CurrentUser +if ($ExecutionPolicy -eq "RemoteSigned") { + Write-Verbose "Execution policy is already set to RemoteSigned for the current user, skipping..." -Verbose +} +else { + Write-Verbose "Setting execution policy to RemoteSigned for the current user..." -Verbose + Set-ExecutionPolicy -Scope CurrentUser RemoteSigned +} + # Ensure chocolatey installed if ([bool](Get-Command -Name 'choco' -ErrorAction SilentlyContinue)) { Write-Verbose "Chocolatey is already installed, skip installation." -Verbose