Microsoft Virtualization Discussions

Latest PowerShell toolkit will not import the module

Andrew7193
16,930 Views

All I have downloaded and installed the latest PowerShell Toolkit 9.7.1. I am running PowerShell 7.0.3 and when I try to run the command Import-Module DataONTAP I get this (verbose mode):

import-module DataONTAP -verbose

VERBOSE: Loading module from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.psd1'.
VERBOSE: Loading 'Assembly' from path 'C:\program files\powershell\7\Modules\DataONTAP\OntapiPS.dll'.
VERBOSE: Loading 'Executable' from path 'C:\program files\powershell\7\Modules\DataONTAP\OntapiPS.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.HostUtilities.dll'.
VERBOSE: Loading 'Executable' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.HostUtilities.dll'.
VERBOSE: Loading 'TypesToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.Type.ps1xml'.
VERBOSE: Loading 'TypesToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.C.Type.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.C.Format.ps1xml'.
VERBOSE: Loading module from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.dll'.
Import-Module: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

That last error is on DataONTAP.dll I asume. Has any one run across this? 

1 ACCEPTED SOLUTION

mcgue
16,780 Views

I have been able to recreate this issue with PowerShell 7.0.3 and opened bug 1344144 on this issue.  Using PowerShell 5.1 I did not have the issue. 

View solution in original post

13 REPLIES 13

mcgue
16,781 Views

I have been able to recreate this issue with PowerShell 7.0.3 and opened bug 1344144 on this issue.  Using PowerShell 5.1 I did not have the issue. 

Andrew7193
16,767 Views

I did not either. I believe it worked in 7.0.1 but don't quote me as it was a preview release and I ripped it out to use the actual "supported" version of Powershell 7.0.3

Andrew7193
16,463 Views

This error presents itself in 7.0.2 as well.

Andrew7193
16,460 Views

Is the bug public so I can follow the progress? I looked it up (1344144) and did not see it.

BenFB
15,676 Views

@mcgue is there any progress on this? We require PowerShell 7 (7.0.3) and currently have to fallback to 5 to get the NetApp PowerShell Toolkit working.

OhGross
14,326 Views

Has there been any progress on this bug?

OhGross
12,983 Views

This is not a solution to the issue.  The issue still remains that the PS module will not load with PS 7.0.3 or higher.

KevinMDavis
7,494 Views

Why is this marked as a "solution" and the problem marked as "solved"? That's BS, and you have to know that.  Requiring people to downgrade their environment to PS 5.1, when the entire world has been moving to 7x for a couple of years now, is NOT a solution.  This is bogus.

Latest NetApp toolkit, 9.8, powershell 7.3.3, and still...so thanks for nothing for this "solution".

PS C:\bin\SVN> Import-Module DataONTAP -Verbose
VERBOSE: Loading module from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.psd1'.
VERBOSE: Loading 'Assembly' from path 'C:\program files\powershell\7\Modules\DataONTAP\OntapiPS.dll'.
VERBOSE: Loading 'Assembly' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.HostUtilities.dll'.
VERBOSE: Loading 'TypesToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.Type.ps1xml'.
VERBOSE: Loading 'TypesToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.C.Type.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.Format.ps1xml'.
VERBOSE: Loading 'FormatsToProcess' from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.C.Format.ps1xml'.
VERBOSE: Loading module from path 'C:\program files\powershell\7\Modules\DataONTAP\DataONTAP.dll'.
Import-Module: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.3.3.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

 

aces
103 Views

I have gotten it to work fine.

The environment has to be set in the shortcut under target when starting PS

"C:\Program Files\PowerShell\7\pwsh.exe" -noe -c "& 'C:\Program Files\PowerShell\7\Modules\SnapCenter\Scripts\Initialize-SnapCenterPS-Environment.ps1' 'NetApp'"

And then I used dataontap module from:

‌‌SnapCenterPS C:\> Import-Module "C:\Program Files\NetApp\SMCore\PSToolkit\dataontap" -verbose

No errors

Francis_Favorini
14,068 Views

Still a problem with PowerShell 7.1.3 and DataONTAP module 9.8.0.

Import-Module: Could not load type 'System.Management.Automation.PSSnapIn' from assembly 'System.Management.Automation, Version=7.1.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

 

OhGross
14,054 Views

@Francis_Favorini - Thanks for the update.  I'm about to cutover to a new laptop and was thinking about this yesterday... I must have been thinking loud enough for others to hear.

 

Cheers,

EG

Vandi
13,888 Views

It’s not just NetApp toolkit, but looks like Snapcenter/SnapDrive powershell modules have similar results.

OhGross
12,971 Views

NetApp just published a new PS Tool Kit (9.9.1) that per the install guide will work with PS 7.0.3 and above.

Haven't tested yet but will update this if i see any issues... if no update, the new version is working.

 

Big thanks to Joe T. (our TAM) for sending me the info.

Public