PureStorage-OpenConnect / powershell-toolkit-3

PowerShell Toolkit 3.x
Apache License 2.0
6 stars 1 forks source link

Import-Module purestoragepowershelltoolkit fails with a cyclic dependency error #89

Closed SQLBek closed 1 year ago

SQLBek commented 1 year ago

Installed a fresh copy of the toolkit (onto a relatively brand new Windows 2019 server VM).

Error:

PS C:\Users\ayun> import-module purestoragepowershelltoolkit
import-module : The required module 'PureStoragePowerShellToolkit.Core' is not loaded. The module 'PureStoragePowerShellToolkit.Core' has a requiredModule
'PureStoragePowerShellToolkit.FlashArray' in its module manifest 'C:\Program
Files\WindowsPowerShell\Modules\PureStoragePowerShellToolkit.Core\3.0.1\PureStoragePowerShellToolkit.Core.psd1' that points to a cyclic dependency.
At line:1 char:1
+ import-module purestoragepowershelltoolkit
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Program File...elltoolkit.psd1:String) [Import-Module], MissingMemberException
    + FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.2268
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2268
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Entire workflow here including module installation.

Screenshot 2023-07-12 152654

It does seem that one can execute 'import-module purestoragepowershelltoolkit.flasharray' followed by 'import-module purestoragepowershelltoolkit.core' then execute 'import-module purestoragepowershelltoolkit' without error.

aguzev commented 1 year ago

That's a reported bug in PowerShell 5. Fortunately, the workaround does not affect any functionality in this case.

aguzev commented 1 year ago

@SQLBek, please, update the PureStoragePowerShellToolkit.Core module.