Subscribe
Accepted Solution

Powershell Module DataONTAP

Hey guys,

 

i started some tryouts for MS Powershell scripting. First of all I will give u a short overview about my system configuration:

 

 

ONTAP 9.1P7 on AFF8040

Windows 7 Enterprise SP1 (latest Windows Updates)

NetApp Powershell Toolkit 4.4

Microsoft Powershell 5.1

 

 

I got the following problem. When I try to import the DataONTAP-PS-Module in the Powershell ISE (64-bit), I get this error message:

 

PS C:\Windows\System32> Import-Module DataONTAP
Import-Module : The specified module 'DataONTAP' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
+ Import-Module DataONTAP
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (DataONTAP:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

 

 

When I try to import the module via the Powershell console I get NO error messages.

 

Both tools show me the same infos when using the get-host cmdlet:

 

Name : Windows PowerShell ISE Host
Version : 5.1.14409.1005
InstanceId : ba0b2d74-0a69-409b-882f-e94dc2ba7eb8
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : de-DE
CurrentUICulture : de-DE
PrivateData : Microsoft.PowerShell.Host.ISE.ISEOptions
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

 

Do you guys have any ideas?

 

Greets,

 

tbshpgn

 

 

 

 

 

 

Re: Powershell Module DataONTAP

Hello @tbshpgn,

 

A couple of questions...

 

  • You're saying that the PowerShell ISE is unable to load the module, but a standard PowerShell window has no issues?
  • Are you running the the ISE as an administrator and the PoSh window as a regular user?  Or, the inverse?
  • What is the output of "Get-Module -ListAvailable" for both?
  • What is the value of $env:PSModulePath for both?
  • Which version of the PSTK are you using?  Was it installed as an administrator?

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Powershell Module DataONTAP

Hello Andrew,

 

- yes, in the morning i got this issues - now - after reinstalling the Windows Management Framework 5.1 the problem occurs on both - console and ISE

- I'm running both - the console and the ISE - as a normal user - running both as an administrator brings up the same error message

- Get-Godule -ListAvailable shows the following output:

 

Directory: C:\Program Files\WindowsPowerShell\Modules


ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}
Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, Save-Module, Update-Module...}


Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules


ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.0.0 AppLocker {Set-AppLockerPolicy, Get-AppLockerPolicy, Test-AppLockerPolicy, Get-AppLockerFileInformation...}
Manifest 1.0.0.0 BitsTransfer {Add-BitsFile, Remove-BitsTransfer, Complete-BitsTransfer, Get-BitsTransfer...}
Manifest 1.0.0.0 CimCmdlets {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession...}
Script 1.0.0.0 ISE {New-IseSnippet, Import-IseSnippet, Get-IseSnippet}
Manifest 1.0.1.0 Microsoft.PowerShell.Archive {Compress-Archive, Expand-Archive}
Manifest 3.0.0.0 Microsoft.PowerShell.Diagnostics {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter...}
Manifest 3.0.0.0 Microsoft.PowerShell.Host {Start-Transcript, Stop-Transcript}
Manifest 1.0.0.0 Microsoft.PowerShell.LocalAccounts {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup...}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path...}
Script 1.0 Microsoft.PowerShell.ODataUtils Export-ODataEndpointProxy
Manifest 3.0.0.0 Microsoft.PowerShell.Security {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Format-List, Format-Custom, Format-Table, Format-Wide...}
Manifest 3.0.0.0 Microsoft.WSMan.Management {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuickConfig...}
Manifest 1.0.0.0 NetworkSwitchManager {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEthernetPort, Get-NetworkSwitchEthernetPort, Remove-NetworkSwitchEthernet...
Manifest 1.1 PSDesiredStateConfiguration {Set-DscLocalConfigurationManager, Start-DscConfiguration, Test-DscConfiguration, Publish-DscConfiguration...}
Script 1.0.0.0 PSDiagnostics {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace...}
Binary 1.1.0.0 PSScheduledJob {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-JobTrigger...}
Manifest 2.0.0.0 PSWorkflow {New-PSWorkflowExecutionOption, New-PSWorkflowSession, nwsn}
Manifest 1.0.0.0 PSWorkflowUtility Invoke-AsWorkflow
Manifest 1.0.0.0 TroubleshootingPack {Get-TroubleshootingPack, Invoke-TroubleshootingPack}

 

 

- $env:OSModulePath show the following output:

\\FILESERVER\UserData\USERPROFILE\Documents\WindowsPowerShell\Modules; - we are using folder-redirection for user specific documents / pictures / music /desktop / etc pp.

C:\Program Files\WindowsPowerShell\Modules;

C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\

 

- I'm using the NetApp PowerShell Toolkit v.4.4.0 - installed with administrative priviledges

 

Greets,

 

tbshpgn

 

Re: Powershell Module DataONTAP

Have you tried to import the module using the full path?

 

Import-Module "C:\Program Files (x86)\NetApp\NetApp PowerShell Toolkit\Modules\DataONTAP"

If that works, then you need to update the PSModulePath...which is normally done by the installer, not sure why your's was not updated.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Powershell Module DataONTAP

Hi Andrew,

 

importing the module with full path is working. I'll try to reinstall the NetApp PowerShell Toolkit tommorrow.

 

Thank you for your helpful answers Smiley Happy

 

Greets,

 

Tobi

Re: Powershell Module DataONTAP

Hey guys,

 

reinstalling the NetApp Powershell Toolkit 4.4 three times was helpful. Now i can import the module via "import-module DataONTAP" - without the need to serve the full path.

 

Thanks for helping.

 

Greets,

 

tbshpgn