Posts Tagged ‘global’


First rule of PowerShell scoping rules…

Wednesday, March 6th, 2013 by Alex Riedel
… never talk about PowerShell scoping rules. Judging from the posts, emails and questions we get about variable scope in PowerShell Studio forms, PowerShell scoping rules are shrouded in mystery. When you read about_scopes you get a lot of information. When you come from any other scripting language, for example VBScript, you are used to two scopes; global and local. The default scope of a variable in VBScript depends on its first use or its declaration. So if you want a variable to have a specific scope you just declare it with a DIM statement. This code sample illustrates…   More »