# Management Scripts Most scripts here require the Tools.ps1 script. You can dot source that script like this: . $([Scriptblock]::Create((New-Object Net.WebClient).DownloadString('https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Tools.ps1'))) You can then run any of the scripts using the Run-Script function: Run-Script -LivePSScript Script-Name If you're using an RMM tool, the scripts in the /rmm directory are all that's needed to hook the main script in this directory. ## Uploading files After dot-sourcing `Tools.ps1`, scripts can upload a completed file to the Emberkom FileDrop: ```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}" ``` 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. Uploads use [binary chunks](https://docs.liquidfiles.com/api/v4.3/attachments/chunks.html) with a default 10 MiB buffer, so large files do not need to fit in memory. The FileDrop's size and extension restrictions are checked before upload. `-ChunkSizeMB`, `-RetryCount`, and `-TimeoutSeconds` control chunk size, retries, and each request's timeout; `-Verbose` displays transfer details. Allow the RMM job to run for the entire upload. The function waits for completion and retries failed chunks within that run; it does not resume across process restarts. LiquidFiles tokens expire after 24 hours. Final submission is attempted once: if its response is lost, check the FileDrop before rerunning to avoid duplicate notifications. Offline tests (no uploads or notifications): ```powershell powershell.exe -NoProfile -File .\tests\Upload-File.Tests.ps1 ```