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 <me@bdang.it>
This commit is contained in:
Ben Dang
2018-10-25 17:45:14 +02:00
committed by Richard Kuhnt
parent 3c0c39db8b
commit 1d27f264b7
+1 -1
View File
@@ -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'"