Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Commit bf94aac

Browse files
author
Brian
committed
Update PowerVCF.psm1
1 parent 1e83bb9 commit bf94aac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PowerVCF.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,13 +3134,13 @@ Function Get-VCFTask {
31343134

31353135
Param (
31363136
[Parameter (Mandatory = $false)] [ValidateNotNullOrEmpty()] [String]$id,
3137-
[Parameter (Mandatory = $false)] [ValidateNotNullOrEmpty()] [String]$status
3137+
[Parameter (Mandatory = $false)] [ValidateSet("SUCCESSFUL", "FAILED")] [String]$status
31383138
)
31393139

31403140
Try {
31413141
createHeader # Calls createHeader function to set Accept & Authorization
31423142
checkVCFToken # Calls the CheckVCFToken function to validate the access token and refresh if necessary
3143-
if ( -not $PsBoundParameters.ContainsKey("id")) {
3143+
if ( -not $PsBoundParameters.ContainsKey("id") -and ( -not $PsBoundParameters.ContainsKey("status"))) {
31443144
$uri = "https://$sddcManager/v1/tasks/"
31453145
$response = Invoke-RestMethod -Method GET -URI $uri -headers $headers
31463146
$response.elements
@@ -3151,7 +3151,7 @@ Function Get-VCFTask {
31513151
$response
31523152
}
31533153
if ($PsBoundParameters.ContainsKey("status")) {
3154-
$uri = "https://$sddcManager/v1/tasks/$id"
3154+
$uri = "https://$sddcManager/v1/tasks/"
31553155
$response = Invoke-RestMethod -Method GET -URI $uri -headers $headers
31563156
$response.elements | Where-Object { $_.status -eq $status }
31573157
}

0 commit comments

Comments
 (0)