16 February 2015

Variable scope

declare a variable in script scope

$Script:text  = 'text'


alternative to scope is synchronized collections

$hash = [hashtable]::Synchronized(@{})
$hash.text = "text"

No comments:

Post a Comment