Fix4
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
function Import-ScriptsFromUrls {
|
||||
param (
|
||||
[string[]] $ScriptUrls
|
||||
[string[]] $ScriptUrls,
|
||||
[string] $LocalPath
|
||||
)
|
||||
|
||||
foreach ($url in $ScriptUrls) {
|
||||
Write-Host "Importing script from $url"
|
||||
Invoke-Expression (Invoke-WebRequest -Uri $url -UseBasicParsing).Content
|
||||
$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
|
||||
Write-Host "Importing script from $localFile"
|
||||
. $localFile
|
||||
}
|
||||
}
|
||||
|
||||
$baseUrl = "https://git.justw.tf/Lightemerald/setup-script/raw/branch/main/"
|
||||
$localPath = "C:\setup-scripts"
|
||||
$scriptUrls = @(
|
||||
($baseUrl + "setupTmp.ps1"),
|
||||
($baseUrl + "setupOffice.ps1"),
|
||||
@@ -19,6 +26,7 @@ $scriptUrls = @(
|
||||
($baseUrl + "setupUpdate.ps1")
|
||||
)
|
||||
|
||||
Import-ScriptsFromUrls -ScriptUrls $scriptUrls -LocalPath $localPath
|
||||
Import-ScriptsFromUrls -ScriptUrls $scriptUrls
|
||||
|
||||
function Setup {
|
||||
|
||||
Reference in New Issue
Block a user