Fix9
This commit is contained in:
@@ -4,16 +4,18 @@ function Import-ScriptsFromUrls {
|
||||
[string] $LocalPath
|
||||
)
|
||||
|
||||
$scripts = @()
|
||||
|
||||
foreach ($url in $ScriptUrls) {
|
||||
$fileName = Split-Path -Leaf $url
|
||||
$localFile = Join-Path -Path $LocalPath -ChildPath $fileName
|
||||
Write-Host "Downloading script from $url to $localFile"
|
||||
Invoke-WebRequest -Uri $url -OutFile $localFile -UseBasicParsing
|
||||
Write-Host "Importing script from $localFile"
|
||||
# allow running scripts
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
|
||||
. $localFile
|
||||
$scripts += $localFile
|
||||
}
|
||||
|
||||
return $scripts
|
||||
}
|
||||
|
||||
$baseUrl = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/"
|
||||
@@ -27,7 +29,12 @@ $scriptUrls = @(
|
||||
($baseUrl + "setupUpdate.ps1")
|
||||
)
|
||||
|
||||
Import-ScriptsFromUrls -ScriptUrls $scriptUrls -LocalPath (Join-Path $env:LOCALAPPDATA "Temp")
|
||||
$scripts = Import-ScriptsFromUrls -ScriptUrls $scriptUrls -LocalPath (Join-Path $env:LOCALAPPDATA "Temp")
|
||||
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
|
||||
foreach ($script in $scripts) {
|
||||
. $script
|
||||
}
|
||||
|
||||
|
||||
function Setup {
|
||||
param (
|
||||
|
||||
Reference in New Issue
Block a user