developer/api/v1/versions/Set-VersionArchive.ps1
function Set-VersionArchive { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory)] [string] $AppAlias, [Parameter(Mandatory)] [string] $VersionAlias, [string] $ArchiveUri, [string] $FilePath, [ValidateSet("constructive", "destructive")] [string] $PatchMode = "destructive" ) if (!$ArchiveUri -and !$FilePath) { throw [ArgumentException] "Either ArchiveUri or FilePath must be specified." } if ($ArchiveUri -and $FilePath) { throw [ArgumentException] "ArchiveUri and FilePath cannot be used together." } $query = "?action=setArchive&patchMode=$PatchMode" if ($ArchiveUri) { $query += "&archiveUri=$ArchiveUri" return Invoke-Api Post "/developer/api/v1/versions/$AppAlias/$VersionAlias/$query" } if ($PSCmdlet.ShouldProcess($VersionAlias)) { return Invoke-Api Post "/developer/api/v1/versions/$AppAlias/$VersionAlias/$query" -FileBody $FilePath } } |