Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Pass data back from a PSSession to local

$
0
0

Hello All,

I'm using a remote-session to collect some additional information on a remote server.

My script executes perfectly, but I would like to get the result back to my local powershell session as a variable

How can I accomplish this?

This is what I run:

$session = New-PSSession -computername Server
Enter-PSSession $session
$domain=gwmi win32_ntdomain

How do I get this $domain value back to my local session?

Thanks?

Filip


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>