Update samy.ps1
This commit is contained in:
5
samy.ps1
5
samy.ps1
@@ -111,17 +111,18 @@ function Import-SamyModule {
|
|||||||
$resp = Invoke-WebRequest -Uri $url -UseBasicParsing -ErrorAction Stop
|
$resp = Invoke-WebRequest -Uri $url -UseBasicParsing -ErrorAction Stop
|
||||||
$content = $resp.Content
|
$content = $resp.Content
|
||||||
if (-not $content) {
|
if (-not $content) {
|
||||||
Write-Host "[Error] Module $Name from $url returned empty content." -ForegroundColor Red
|
Write-Host ("[Error] Module {0} from {1} returned empty content." -f $Name, $url) -ForegroundColor Red
|
||||||
throw "Empty module content."
|
throw "Empty module content."
|
||||||
}
|
}
|
||||||
Invoke-Expression $content
|
Invoke-Expression $content
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host "[Error] Failed to load module $Name from $url: $($_.Exception.Message)" -ForegroundColor Red
|
Write-Host ("[Error] Failed to load module {0} from {1}: {2}" -f $Name, $url, $_.Exception.Message) -ForegroundColor Red
|
||||||
throw
|
throw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Load subsystems in a predictable order
|
# Load subsystems in a predictable order
|
||||||
Import-SamyModule -Name 'Samy.Logging.ps1' # Write-LogHelper, Write-LogHybrid
|
Import-SamyModule -Name 'Samy.Logging.ps1' # Write-LogHelper, Write-LogHybrid
|
||||||
Import-SamyModule -Name 'Samy.SVSBootstrap.ps1' # Install-SVSMSP, cleanup, NuGet bootstrap
|
Import-SamyModule -Name 'Samy.SVSBootstrap.ps1' # Install-SVSMSP, cleanup, NuGet bootstrap
|
||||||
|
|||||||
Reference in New Issue
Block a user