Skip to content

Commit

Permalink
Update PowerVCF.psm1
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerVCF committed Oct 6, 2021
1 parent d521525 commit 5271ab0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions PowerVCF.psm1
Expand Up @@ -3147,10 +3147,17 @@ Function Get-VCFTask {
}
if ($PsBoundParameters.ContainsKey("id")) {
$uri = "https://$sddcManager/v1/tasks/$id"
Try {
$response = Invoke-RestMethod -Method GET -URI $uri -headers $headers
}
catch {
if ($_.Exception.Message -eq "The remote server returned an error: (404) Not Found.") {
Write-Output "Task ID Not Found"
}
}
$response
}
if ($PsBoundParameters.ContainsKey("status")) {
elseif ($PsBoundParameters.ContainsKey("status")) {
$uri = "https://$sddcManager/v1/tasks/"
$response = Invoke-RestMethod -Method GET -URI $uri -headers $headers
$response.elements | Where-Object { $_.status -eq $status }
Expand Down Expand Up @@ -4675,4 +4682,4 @@ Function Debug-CatchWriter {
}
Export-ModuleMember -Function Debug-CatchWriter

######### End Useful Script Functions ##########
######### End Useful Script Functions ##########

0 comments on commit 5271ab0

Please sign in to comment.