Import-Module errors with ps-debug -strict

Topics: User Forum
Nov 29, 2010 at 7:49 PM

Hello,

I run my scripts with ps-debug -strict enabled to keep my from trying to call a var that hasn't been set yet.  When  I do an Import-Module on PSCX I get an error on a var,'$SCRIPT:helpCache',  that hasn't been defined yet.  For now I turn off ps-debug load the module and then turn it back on.  Is there some other way around this?  Here's the errors.  Also with the 2nd error Pscx.GetHelp.psm1 does exist in the directory where the script is saying it does not exist.

 

The variable '$SCRIPT:helpCache' cannot be retrieved because it has not been set.
At F:\DeltaV\OS_Hotfixes\Win7-2008\Functions\Modules\PSCX\Modules\GetHelp\Pscx.GetHelp.psm1:5 char:24
+ if ((!$SCRIPT:helpCache <<<< ) -or $RefreshCache) {
    + CategoryInfo          : InvalidOperation: (SCRIPT:helpCache:Token) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : VariableIsUndefined

Import-Module : The specified module 'F:\DeltaV\OS_Hotfixes\Win7-2008\Functions\Modules\PSCX\Modules\GetHelp\Pscx.GetHe
lp.psm1' was not loaded because no valid module file was found in any module directory.
At F:\DeltaV\OS_Hotfixes\Win7-2008\Functions\Modules\PSCX\Pscx.psm1:197 char:17
+             Import-Module <<<<  $path -DisableNameChecking
    + CategoryInfo          : ResourceUnavailable: (F:\DeltaV\OS_Ho...cx.GetHelp.psm1:String) [Import-Module], FileNot
   FoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Developer
Nov 29, 2010 at 8:15 PM
That's my fault - I'm pretty sure this is fixed in the latest builds from codeplex. Let me verify and then I'll point you to the right psm1 so you can download it and overwrite your current install.
-Oisin

On Mon, Nov 29, 2010 at 2:49 PM, mprindle <notifications@codeplex.com> wrote:

From: mprindle

Hello,

I run my scripts with ps-debug -strict enabled to keep my from trying to call a var that hasn't been set yet. When I do an Import-Module on PSCX I get an error on a var,'$SCRIPT:helpCache', that hasn't been defined yet. For now I turn off ps-debug load the module and then turn it back on. Is there some other way around this? Here's the errors. Also with the 2nd error Pscx.GetHelp.psm1 does exist in the directory where the script is saying it does not exist.

The variable '$SCRIPT:helpCache' cannot be retrieved because it has not been set.
At F:\DeltaV\OS_Hotfixes\Win7-2008\Functions\Modules\PSCX\Modules\GetHelp\Pscx.GetHelp.psm1:5 char:24
+ if ((!$SCRIPT:helpCache <<<< ) -or $RefreshCache) {
+ CategoryInfo : InvalidOperation: (SCRIPT:helpCache:Token) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : VariableIsUndefined

Import-Module : The specified module 'F:\DeltaV\OS_Hotfixes\Win7-2008\Functions\Modules\PSCX\Modules\GetHelp\Pscx.GetHe
lp.psm1' was not loaded because no valid module file was found in any module directory.
At F:\DeltaV\OS_Hotfixes\Win7-2008\Functions\Modules\PSCX\Pscx.psm1:197 char:17
+ Import-Module <<<< $path -DisableNameChecking
+ CategoryInfo : ResourceUnavailable: (F:\DeltaV\OS_Ho...cx.GetHelp.psm1:String) [Import-Module], FileNot
FoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

Read the full discussion online.

To add a post to this discussion, reply to this email (Pscx@discussions.codeplex.com@discussions.codeplex.com)

To start a new discussion for this project, email Pscx@discussions.codeplex.com@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--

---
404 signature missing
Nov 29, 2010 at 8:17 PM

Thanks. :)