Answer the question
In order to leave comments, you need to log in
How to pass execution results/variables between two different scripts?
Good day everyone. All functionality is implemented on the Windows Server 2008 r2 platform with Powershell version 4.
There is a Wishlist - to execute the code by the remote machine.
Everything works fine via:
Invoke-Сommand -Session $session -FilePath "ПутьКСкрипту"
return БУКВА
, because I need to read what's going on there.Answer the question
In order to leave comments, you need to log in
First option. Create a custom object with fields to be returned, like so:
[pscustomobject]@{
SeverName = $Name;
DiskLetter = $DiskLetter;
}
Then serialize it into xml via Export-Clixml $report
Upload it to the ball where the first script will look for it.
Second option. Use TCP client/server communication.
For example, poshcode.org/4601 has more options online.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question