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