OneIdentity / safeguard-ps

One Identity Safeguard PowerShell scripting resources
Apache License 2.0
22 stars 27 forks source link

Add support for -FromRemote #445

Closed CodyBatt closed 1 year ago

CodyBatt commented 2 years ago

The SPP API allows for most file uploads to be construed as downloads from HTTP or CIFS sources. It would be nice if the module supported this. I suggest something like this:

CIFS $remote = New-SafeguardRemoteFile -Type Cifs -CifsCredentials (Get-Credential) -CifsPath \\server\path\to\file

HTTP $remote = New-SafeguardRemoteFile -Type Http -HttpUrl https://server/some/file -Insecure (for ignore TLS errors)

Then for these commands add a -FromRemote $remote option that can be used instead of specifying the file to upload:

Set-SafeguardPatch
Install-SafeguardPatch
Set-SafeguardDiagnosticPackage
Import-SafeguardBackup

These would then use the FromRemote endpoint to stage the file rather than uploading it, SPP will download it from the remote source.

petrsnd commented 1 year ago

@CodyBatt I believe this is implemented in safeguard-ps now, please confirm.

CodyBatt commented 1 year ago

Kind of. It's supported for patch. Backup and DiagnosticPackage are still missing remote support, but I'm going to close this as those use cases aren't important to me.