From 1d27f264b7763ed71fc46d128e7f8a94ce84e488 Mon Sep 17 00:00:00 2001 From: Ben Dang Date: Thu, 25 Oct 2018 08:45:14 -0700 Subject: [PATCH] Fix the check for ExecutionPolicy scope (#2703) Under certain terminals like cmder, `Get-ExecutionPolicy` will show the scope of `Process`. This fix explicitly checks the scope of `CurrentUser`. Signed-off-by: Ben Dang --- bin/install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install.ps1 b/bin/install.ps1 index 106ea598b..352ade63c 100644 --- a/bin/install.ps1 +++ b/bin/install.ps1 @@ -12,7 +12,7 @@ if(($PSVersionTable.PSVersion.Major) -lt 3) { } # show notification to change execution policy: -if((get-executionpolicy) -gt 'RemoteSigned') { +if((get-executionpolicy -scope CurrentUser) -gt 'RemoteSigned') { Write-Output "PowerShell requires an execution policy of 'RemoteSigned' to run Scoop." Write-Output "To make this change please run:" Write-Output "'Set-ExecutionPolicy RemoteSigned -scope CurrentUser'"