developer/api/v1/components/Update-ComponentCount.ps1
function Update-ComponentCount { [CmdletBinding(SupportsShouldProcess)] param( [Parameter(Mandatory)] [string] $AppAlias, [Parameter(Mandatory)] [string] $VersionAlias, [Parameter(Mandatory)] [string] $ComponentAlias, [ValidateRange(0, [int]::MaxValue)] [Nullable[int]] $Count, [ValidateRange(0, [int]::MaxValue)] [Nullable[int]] $MinCount ) if ($Count -and $MinCount) { throw [ArgumentException] "Count and MinCount cannot be used together." } $query = "?action=setInstanceCount" if ($Count) { $query += "&minCountEnabled=0&count=$Count" } if ($MinCount) { $query += "&minCountEnabled=1&minCount=$MinCount" } if ($PSCmdlet.ShouldProcess($ComponentAlias)) { return Invoke-Api Post "/developer/api/v1/components/$AppAlias/$VersionAlias/$ComponentAlias/$query" } } |