mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-09-24 22:36:05 +00:00
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:
+1
-1
@@ -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'"
|
||||
|
||||
Reference in New Issue
Block a user