Affects both:
- true scope modifiers such as
$global:
- namespace variable notation such as
$function:
Steps to reproduce
Prerequisites:
- enable remoting on the calling machine
- run as admin.
# Define a variable and function, both named 'foo'.
function foo { 'func' }; $global:foo = 'var'
# Try to access these definitions remotely via $using
Invoke-Command -ComputerName . { $using:foo; $using:global:foo; $using:function:foo }
Expected behavior
Actual behavior
That is, $using:global:foo and $using:function:foo quietly evaluated to $null.
Environment data
PowerShell Core 6.2.0-rc.1
Windows PowerShell v5.1
Affects both:
$global:$function:Steps to reproduce
Prerequisites:
Expected behavior
Actual behavior
That is,
$using:global:fooand$using:function:fooquietly evaluated to$null.Environment data