I like C# so much better than PS but this time I'm forced to write a script... I need to alter "global" variable from inside a function without passing the variable as parameter. Is it even possible? Here is an abstract:
$a = 0
$b = 0
$c = 0
function Increment($var1, $var2)
{
$a = $var1
$b = $var2
$c++
}
Unlike C# in PS function variable are function scope bound and they remain unchanged outside of the scope of the function if used as described above. How can I make this work so the script variable are accessed by reference?
$script:a$script:betc....