@@ -85,6 +85,10 @@ function Initialize-PfaVcfWorkloadDomain {
8585 catch {
8686 throw " Please install PowerVCF with install-module PowerVCF."
8787 }
88+ if ($null -eq $global :sddcManager )
89+ {
90+ throw " Please connect to SDDC Manager with Request-VcfToken."
91+ }
8892 if ($psversiontable.PSEdition -ne " Core" )
8993 {
9094 throw " The cmdlet Initialize-PfaVcfWorkloadDomain is only supported with PowerShell Core (7.x or later)."
@@ -94,7 +98,6 @@ function Initialize-PfaVcfWorkloadDomain {
9498 throw " iSCSI can only be specified with vVols. VMFS can only be principal storage when deployed with Fibre Channel."
9599 }
96100 Write-Progress - id 1 - Activity " VCF and Pure ESXi Host Commission Process" - Status " Verifying input" - PercentComplete 5
97- Write-Debug - Message ($vcfpools | out-string )
98101 $ErrorActionPreference = " stop"
99102 if ($Vvol -ne $true )
100103 {
@@ -136,6 +139,7 @@ function Initialize-PfaVcfWorkloadDomain {
136139 }
137140 Write-Debug - Message $foundProtocol
138141 $vcfpools = Get-VCFNetworkPool
142+ Write-Debug - Message ($vcfpools | out-string )
139143 if (($vcfpools.name -contains $VcfNetworkPool ) -ne $true )
140144 {
141145 throw " Invalid VCF network pool ($ ( $vcfnetworkpool ) ). Please verify network pools with Get-VCFNetworkPool"
@@ -389,6 +393,10 @@ function Get-PfaVcfVasaProvider {
389393 catch {
390394 throw " Please install PowerVCF with install-module PowerVCF."
391395 }
396+ if ($null -eq $global :sddcManager )
397+ {
398+ throw " Please connect to SDDC Manager with Request-VcfToken."
399+ }
392400 if ($psversiontable.PSEdition -ne " Core" )
393401 {
394402 throw " The cmdlet Get-PfaVcfVasaProvider is only supported with PowerShell Core (7.x or later)."
@@ -459,6 +467,10 @@ function New-PfaVcfVasaProvider {
459467 catch {
460468 throw " Please install PowerVCF with install-module PowerVCF."
461469 }
470+ if ($null -eq $global :sddcManager )
471+ {
472+ throw " Please connect to SDDC Manager with Request-VcfToken."
473+ }
462474 if ($psversiontable.PSEdition -ne " Core" )
463475 {
464476 throw " The cmdlet New-PfaVcfVasaProvider is only supported with PowerShell Core (7.x or later)."
0 commit comments