Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

return values from workflow parallel

$
0
0

hi all,

trying to figure this one out... i want to create a workflow that will get some data from servers in parallel and return a variable with that data so i can use it further down the script (outside of the workflow)

here's what i have so far:

Powershell
Import-ModuleRemoteDesktopworkflowwf_LoadSessionHost_RDSHDataLIVE{$broker="broker.domain.local"$RDSHDataLIVE=@()$wmiNamespace="root\cimv2\rdms"$wmiRDSHServerQuery="SELECT * FROM Win32_RDSHServer"foreach-parallel($RDSHin(Get-WmiObject-Namespace$wmiNamespace-Query$wmiRDSHServerQuery-PSComputerName$broker-PSAuthenticationPacketPrivacy)){#$result = InlineScriptInlineScript{write-host"$($using:RDSH.name)"if(Test-Connection-ComputerName$using:RDSH.Name-Count1-Quiet){If((Get-WmiObject-Class"Win32_TerminalServiceSetting"-Namespace"root\CIMV2\...

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

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