我正在尝试Invoke-Sqlcmd
并行运行两个,然后等待所有结果。
$server1 = '...'
$server2 = '...'
workflow work {
parallel {
$r1 = Invoke-Sqlcmd -ServerInstance $server1 'select 1 a'
$r2 = Invoke-Sqlcmd -ServerInstance $server2 'select 2 a'
}
}
work
# do something with $r1 and $r2. How to access the variables here?
- 如何传递
$server1
和$server2
到代码块? - 如何获取
$r1
和$r2
从并行块?