Aug 6, 2010 at 3:19 PM
Edited Aug 6, 2010 at 3:34 PM
There is a bug with Modules that can cause PSCX to be removed incorrectly ( basically leaves it Imported, but corrupted ).
This can happen if:
-A module uses a Module Manifest and it uses the ModuleToProcess Section
-Or a module uses Import-Module ( including importing Pscx)
-Or a module uses "Get-Module -ListAvailable" during the Import-Module process (.psm1)
-One of the above is true and "Get-Module -ListAvailable" is called anywhere - doesn't matter if a user uses it or if in a script or module function
-One of the above is true and the user uses "Remove-Module" and removes a module
I've seen issues at work when an exported variable/module scoped variable would occasionally get set to $null. I finally saw it where I could reproduce it when working with Powertab ( powertab.codeplex.com ). If I removed Powertab, PSCX (Version 188.8.131.52
) would go away as well. JasonMArcher modified the currently released version a few days ago to prevent it from being as bad, now if you remove Powertab pscx doesn't go away, but just using "Get-Module -ListAvailable" will cause all module scoped
or exported variables to be set to $null. Not sure how much that effects Pscx, but it sure messes up lots of things for me.
If interested in this bug, please take the time to go to Connect.Microsoft.com and vote on it. JasonMArcher was really quick and created feedback for it the same day I let him know about it. It's one of the nastier bugs I've seen in PowerShell and there
isn't an easy work around for it either.
Last Powertab version with issue with Removing PSCX