stop on BITS download errors
reject 0 byte dsa-collector.exe before launching
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#Requires -Version 5.0
|
||||
# Syncro supplies DSAManifestSource, Zip, Upload, and DeleteAfterUpload.
|
||||
# Preserve those caller variables for the repository script.
|
||||
|
||||
# This must run before downloading Tools.ps1, including on Server 2016.
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
$RmmToolsUrl = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'
|
||||
$RmmToolsClient = New-Object Net.WebClient
|
||||
Try {
|
||||
$RmmToolsText = $RmmToolsClient.DownloadString($RmmToolsUrl)
|
||||
$RmmToolsScript = [Scriptblock]::Create($RmmToolsText)
|
||||
}
|
||||
Catch {
|
||||
Throw "Unable to download or parse Tools.ps1 from ${RmmToolsUrl}: $($_.Exception.Message)"
|
||||
}
|
||||
Finally {
|
||||
$RmmToolsClient.Dispose()
|
||||
}
|
||||
|
||||
# Dot-source in this scope so the RMM input variables remain accessible.
|
||||
. $RmmToolsScript
|
||||
Run-Script -LivePSScript Get-DSAManifest
|
||||
Reference in New Issue
Block a user