mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-05-04 00:31:27 +00:00
set execution policy on scoop install
I've tested this by running updated script as below:
```iex (new-object net.webclient).downloadstring('https://gist.githubusercontent.com/mikhail-tsennykh/f65a3addf22b36681b1eb7c6d708bed2/raw/4040fe0c156512a63b1dcfea2fd5595b26e1a1f1/scoop%2520auto%2520set%2520execution%2520policy%2520test')```
nice to skip extra step (unless there is some good reason not to do it on scoop install).
This commit is contained in:
@@ -4,6 +4,15 @@
|
||||
# iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
|
||||
$erroractionpreference='stop' # quit if anything goes wrong
|
||||
|
||||
# set correct execution policy automatically if not set already:
|
||||
$ep = get-executionpolicy cu;
|
||||
if ($ep -ne "unrestricted") {
|
||||
# Set execution policy on the process to hide error message
|
||||
# that will otherwise show first time this script is run
|
||||
set-executionpolicy unrestricted p
|
||||
set-executionPolicy unrestricted cu
|
||||
}
|
||||
|
||||
# get core functions
|
||||
$core_url = 'https://raw.github.com/lukesampson/scoop/master/lib/core.ps1'
|
||||
echo 'initializing...'
|
||||
|
||||
Reference in New Issue
Block a user