add upload feature to DSA manifest creation
This commit is contained in:
@@ -14,11 +14,10 @@ After dot-sourcing `Tools.ps1`, scripts can upload a completed file to the Ember
|
||||
|
||||
```powershell
|
||||
Upload-File -Path 'C:\ProgramData\Emberkom\Output\report.zip'
|
||||
|
||||
# Inside Get-DSAManifest.ps1, after successful collection:
|
||||
Upload-File -Path $DsaResultPath -Subject "DSA manifest from ${Env:COMPUTERNAME}"
|
||||
```
|
||||
|
||||
`Get-DSAManifest.ps1` uploads its completed CSV or ZIP when `$Upload` is enabled. If `$DeleteAfterUpload` is also enabled, it deletes that same local file only after a confirmed successful upload. Disabled or failed uploads retain the file. `$Zip`, `$Upload`, and `$DeleteAfterUpload` all accept `true`, `$true`, `yes`, `y`, or `1`; `false`, `$false`, `no`, `n`, `0`, or an empty value disable the option. Casing and surrounding whitespace are ignored. The notification subject identifies the computer, and its message includes the source path and collection start time (local time with UTC offset).
|
||||
|
||||
The default destination is `https://xfer.emberkom.com/filedrop/cmd`. The sender defaults to the computer's hostname plus its primary DNS suffix, followed by `@ek-upload.net` (for example, `pc01.example.com@ek-upload.net`). Without a DNS suffix, it uses the hostname. Override these with `-FileDropUrl` and `-From`; `-Subject` and `-Message` are also optional.
|
||||
|
||||
`Upload-File` uses the [LiquidFiles FileDrop API](https://docs.liquidfiles.com/api/v4.3/filedrop/) to obtain a temporary token, upload the file, and submit the message that triggers FileDrop delivery and its configured email notification. It returns a receipt with the path, destination, sender, attachment ID, byte count, and server status. It retains the local file and throws on failure.
|
||||
@@ -31,4 +30,5 @@ Offline tests (no uploads or notifications):
|
||||
|
||||
```powershell
|
||||
powershell.exe -NoProfile -File .\tests\Upload-File.Tests.ps1
|
||||
powershell.exe -NoProfile -File .\tests\Get-DSAManifest.Tests.ps1
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user