CoreOps/Hosts/Remove-SDPHost.ps1
function Remove-SDPHost { param( [parameter(ValueFromPipelineByPropertyName)] [Alias('pipeId')] [string] $id, [parameter(Position=1)] [string] $name, [parameter()] [string] $k2context = 'k2rfconnection' ) <# .SYNOPSIS .EXAMPLE .DESCRIPTION .NOTES Authored by J.R. Phillips (GitHub: JayAreP) .LINK https://www.github.com/JayAreP/K2RF/ #> begin { $endpoint = "hosts" } process { if ($name) { $id = (Get-SDPHost -name $name).id } Write-Verbose "Removing volume with id $id" $endpointURI = $endpoint + '/' + $id $results = Invoke-SDPRestCall -endpoint $endpointURI -method DELETE -k2context $k2context return $results.hits } } |