On form load, I am importing the module from two scripts functions.ps1 and and customscript.ps1. In powershell version 2.0, it works with no issues.However in powershell 3.0, I am getting error " 'is_not_empty' is not recognized as the name of a cmdlet". "is_not_empty" is a function, I defined in functions.ps1.I did some debugging, and found that in version 3.0, any modules or variables that are defined/Initialized under "{ }" can not be accessed out-side of it. However, this works fine in powershell ver 2.0.I want to know, whether it's a bug in version 3.0, or is it a expected behaviour?$handler_form1_Load= {#TODO: Place custom script hereImport-Module -name .\functions.ps1 -GlobalImport-Module -name .\customscript.ps1 -Global}...............$form1.add_Load($handler_form1_Load)=======================================is_not_empty : The term 'is_not_empty' is not recognized as the name of a cmdlet, function, script file, or operable program.Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At C:\MyInstalls\AisCustomBoltz\AisCustomBoltz.ps1:127 char:5+ if (is_not_empty $label2.Text $richTextBox1.Text) {+ ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (is_not_empty:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Have you seen this problem before in this product?