hello:
i have a script that run from a source computer:
$myip = read-host “enter remote ip”
file on remote computer
function test {
& ‘c:\test\test.ps1’
}
Invoke-Command -ComputerName $myip -scriptblock ${function:test} -ArgumentList $myip
#on remote computer i have c:\test\test.ps1 with these lines
param ($ip)
Write-Host “you are on:$ip”
#do task
the problem is that i cannot retrieve $ip, the result on my source station is:
you are on:
thank you