141 153
This commit is contained in:
13
samy.ps1
13
samy.ps1
@@ -139,10 +139,19 @@ $chunks = @(
|
||||
|
||||
|
||||
foreach ($c in $chunks) {
|
||||
$content = Import-SamyChunk -Url $c.Url -Name $c.Name
|
||||
try {
|
||||
$content = Import-SamyChunk -Url $c.Url -Name $c.Name -ErrorAction Stop
|
||||
. ([ScriptBlock]::Create($content))
|
||||
Write-Host "[Success] Loaded: $($c.Name)" -ForegroundColor Green
|
||||
Write-Host "[Success] $($c.Name)" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
$msg = $_.Exception.Message
|
||||
if ([string]::IsNullOrWhiteSpace($msg)) { $msg = "$_" }
|
||||
Write-Host "[Failed] $($c.Name): $msg" -ForegroundColor Red
|
||||
throw # or continue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (-not (Get-Command Invoke-ScriptAutomationMonkey -ErrorAction SilentlyContinue)) {
|
||||
|
||||
Reference in New Issue
Block a user