Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Unable to Import-Module after powershell upgrade to v3.0

2013-04-25
12:00 PM
12,946 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I was able to successfully work until I upgraded the powershell to v3.0, as soon as i upgraded and restarted the machine I am unable to import the module. I have set the execution policy to unrestricted and also the folder is not blocked. Please help fix this.
PS C:\Windows\system32> Import-Module DataONTAP
Import-Module : Could not load file or assembly 'file:///C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Da
0x80131515)
At line:1 char:1
+ Import-Module DataONTAP
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
Thanks
RK
Solved! See The Solution
1 ACCEPTED SOLUTION
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Vinith!
I tried it before, but for some reason it didn't work. Now I have reinstalled the framework and then reinstalled the powershell tool kit and that did the magic.
It works now! Thanks for the help.
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Ravi - Can you try Reinstalling PowerShell Toolkit --> https://communities.netapp.com/docs/DOC-22259
migration has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Vinith!
I tried it before, but for some reason it didn't work. Now I have reinstalled the framework and then reinstalled the powershell tool kit and that did the magic.
It works now! Thanks for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FYI, Powershell v3 automatically imports your modules now, so you shouldn't have to use import-module anymore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding powershell 3.0 auto module loading - That's a nice feature, but you should consider manually loading your modules anyway. This guy sums it up pretty well:
http://stevenmurawski.com/powershell/2012/01/powershell-v3-auto-loading-of-modules
In a nutshell, if the cmdlet you are reaching for is defined in more than one module, you may not know which one Powershell will load. THis may cause unexpected results. Your script behavior could change even though you only added a module to your PSModulePath directory and had not actually changed the script.
