ps/Modules/Alkami.DevOps.Inventory/Public/Remove-PlatformElementDetailById.ps1

40 lines
1.2 KiB
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Remove-PlatformElementDetailById {
<#
.SYNOPSIS
Soft deletes a PlatformElementDetail by Id in BoRG by setting IsCurrent = false
.EXAMPLE
Remove-PlatformElementDetailById -PlatformElementDetailId 1 -BorgUri "http://uri.to.borg.com" -APiKey "b752be2f-9206-4706-a2fb-851162cb29bf"
.PARAMETER PlatformElementDetailId
The id of the element details to be removed.
.PARAMETER BorgUri
Uri to the BoRG REST service.
.PARAMETER ApiKey
Borg Api key. Required for write operations.
#>
[CmdletBinding()]
[OutputType([string])]
Param(
[Parameter(Mandatory = $true)]
[long]$PlatformElementDetailId,
[Parameter(Mandatory = $true)]
[string]$BorgUri,
[Parameter(Mandatory = $true)]
[string]$ApiKey
)
$uri = "$BorgUri/api/platformelementdetails/$PlatformElementDetailId"
$headers = @{ "x-api-key" = $ApiKey }
$response = Invoke-CommandWithRetry -Arguments @($uri, $headers) -Seconds 3 -JitterMin 500 -JitterMax 3000 -ScriptBlock {
param($uri, $headers)
return (Invoke-RestMethod -Uri $uri -Method PATCH -Headers $headers -ContentType "application/json")
}
return ConvertTo-Json $response
}