Hi -
I'm currently writing a simple script. The script will run locally on my machine but it will initiate Resolve-DnsName on a remote computer - also the target machines (the machines that will be resolved). I know I need to pass the value of my test file inside a New-PSSession, though I can't get it working.
Here
$target_computer = Get-Content -Path "C:\Scripts\targets.txt" #hosted in my local machine
Invoke-Command -Session $psremote -ScriptBlock {foreach ($target in $target_computer) {Resolve-DnsName -Name $args[0] -ErrorAction Ignore }} -ArgumentList $target
Please help?