Microsoft Virtualization Discussions

Toolkit 1.3 update problem

sjallabais
4,365 Views

What is the recommended procedure to upgrade the toolkit to 1.3?

I just tried ro replace the files in C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DataONTAP

When I then try to run "Import-Module DataONTAP" again, I get this Error Message:

Import-Module : The following error occurred while loading the extended type data file:
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DataONTAP\DataONTAP.Type.ps1xml : File skipped
because it was already present from "Microsoft.PowerShell".
At line:1 char:14
+ Import-Module <<<<  DataONTAP
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand

1 ACCEPTED SOLUTION

cknight
4,365 Views

To reproduce this issue, I installed a fresh copy of Windows Server 2008 R2 on a VM.  Sure enough, the 1.2 Toolkit loads fine but the 1.3 Toolkit throws the reported error.  To resolve the issue, add the .NET Framework 3.5.1 feature and restart PowerShell.

View solution in original post

5 REPLIES 5

timothyn
4,365 Views

Have you exited & restarted powershell?  Powershell doesn't support fully unloading binary modules so you will need to completely exit the process and start it back up. 

Also you may want to check that you do not have a copy of DataONTAP in both "C:\Users\<username>\Documents\WindowsPowerShell\Modules" and "C:\windows\system32\WindowsPowerShell\v1.0\Modules".  It should only be in one or the other.

cknight
4,365 Views

Thanks, Eric.  Although installing PowerShell v2 modules merely requires copying files, I tend to use the trivial install & uninstall scripts we offer alongside the Toolkit.

To use them for an upgrade, download the zip file and the two scripts into the same directory.  Then close all PowerShell instances that may already have the Toolkit loaded, open a new PowerShell instance with administrative privileges, and do this:

PS C:\> .\Uninstall.ps1


Before continuing, please close all PowerShell instances that have the DataONTAP module loaded.

Remove directory C:\Windows\system32\WindowsPowerShell\v1.0\Modules\\DataONTAP (y/n)? [y]: y


PS C:\> .\Install.ps1
Install to directory C:\Users\Administrator.RTPRRE\Documents\WindowsPowerShell\Modules (y/n)? [y]: n
Install to directory C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ (y/n)? [y]: y

That's it!  Eric has some ideas for improving the scripts, but we aim to keep it very simple.

sjallabais
4,365 Views

Hmm.. All the file placement and install stuff are OK (and toolkit 1.2 are working fine if I replace the Modules\DataONTAP folder)

The system is a newly installed 2008 R2 server with all updates applied.

When I tried again today I see that the first error message I got (slipped my eyes) is actually another one, and when I try once more I get the one reported yesterday:

PS C:\> Import-Module DataONTAP

Import-Module : Could not load file or assembly 'System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, Public

KeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

At line:1 char:14

+ Import-Module <<<<  DataONTAP

    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException

    + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\> Import-Module DataONTAP

Import-Module : The following error occurred while loading the extended type data file:

Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DataONTAP\DataONTAP.Type.ps1xml : File skipped

because it was already present from "Microsoft.PowerShell".

At line:1 char:14

+ Import-Module <<<<  DataONTAP

    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException

    + FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand

If I move the DataONTAP folder from "C:\Windows\system32\WindowsPowerShell\v1.0\Modules\" to "C:\Users\<username>\Documents\WindowsPowerShell\Modules"

I get the same result.

I also tried to set the ExecutionPolicy to Unrestricted (was RemoteSigned), but no difference.

cknight
4,366 Views

To reproduce this issue, I installed a fresh copy of Windows Server 2008 R2 on a VM.  Sure enough, the 1.2 Toolkit loads fine but the 1.3 Toolkit throws the reported error.  To resolve the issue, add the .NET Framework 3.5.1 feature and restart PowerShell.

sjallabais
4,365 Views

Great!!, Now it works.

Thank you very much for the prompt responses!

PS

love the new Invoke-NaSsh and Mount-NaController feature. Suddenly I have a command line environment even more powerful than my good old *nix shell

/Sjalla

Public