function ParamTest($ArgA, [ref] $ArgB)
{
$ArgA = "Hello A!"
// The following line won't work; it is referencing System.Management.Automation.PSReference
$ArgB = "Hello B!"
// This line is the correct way to assign
$ArgB.value = "Hello Test!"
return $ArgA
}
$a = "A.."
$b = "B.."
write-host "a is $a"
write-host "b is $b"
$output = ParamTest -ArgA $a -ArgB ([ref] $b)
write-host "a is now $a"
write-host "b is now $b"