Skip to content

Commit 6456bfc

Browse files
committed
Fixed VCF requirement
1 parent acf4117 commit 6456bfc

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

PureStorage.FlashArray.VMware.VCF/PureStorage.FlashArray.VMware.VCF.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
RequiredModules = @(
6666
@{"ModuleName"="PureStoragePowerShellSDK";"ModuleVersion"="1.13.1.12"}
6767
@{"ModuleName"="PureStorage.FlashArray.VMware.Configuration";"ModuleVersion"="2.0.0.0"}
68-
@{"ModuleName"="PowerVCF";"ModuleVersion"="2.1.0"}
6968
)
7069

7170
# Assemblies that must be loaded prior to importing this module

PureStorage.FlashArray.VMware.VCF/PureStorage.FlashArray.VMware.VCF.psm1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ function Initialize-PfaVcfWorkloadDomain {
7979

8080
)
8181
Import-Module PureStoragePowerShellSDK
82+
try {
83+
Get-InstalledModule -Name PowerVCF -ErrorAction Stop |Out-Null
84+
}
85+
catch {
86+
throw "Please install PowerVCF with install-module PowerVCF."
87+
}
8288
if ($psversiontable.PSEdition -ne "Core")
8389
{
8490
throw "The cmdlet Initialize-PfaVcfWorkloadDomain is only supported with PowerShell Core (7.x or later)."
@@ -377,6 +383,12 @@ function Get-PfaVcfVasaProvider {
377383
will not be liable for any damage or loss to the system.
378384
************************************************************************
379385
#>
386+
try {
387+
Get-InstalledModule -Name PowerVCF -ErrorAction Stop |Out-Null
388+
}
389+
catch {
390+
throw "Please install PowerVCF with install-module PowerVCF."
391+
}
380392
if ($psversiontable.PSEdition -ne "Core")
381393
{
382394
throw "The cmdlet Get-PfaVcfVasaProvider is only supported with PowerShell Core (7.x or later)."
@@ -441,6 +453,12 @@ function New-PfaVcfVasaProvider {
441453
[ValidateSet('iSCSI','FC')]
442454
[string]$Protocol
443455
)
456+
try {
457+
Get-InstalledModule -Name PowerVCF -ErrorAction Stop |Out-Null
458+
}
459+
catch {
460+
throw "Please install PowerVCF with install-module PowerVCF."
461+
}
444462
if ($psversiontable.PSEdition -ne "Core")
445463
{
446464
throw "The cmdlet New-PfaVcfVasaProvider is only supported with PowerShell Core (7.x or later)."

0 commit comments

Comments
 (0)