public/Remove-FreeNasVolume.ps1
function Remove-FreeNasVolume { [CmdletBinding(SupportsShouldProcess)] [Alias()] Param ( [Parameter (Mandatory = $true)] [Int]$Id ) Begin { } Process { $Uri = "/api/v1.0/storage/volume/$Id/" if ($PSCmdlet.ShouldProcess("will be remove" , "The volume with the id $Id")) { $response = Invoke-FreeNasRestMethod -method Delete -body $post -Uri $Uri } } End { } } |