powershell - 如何通过 PowerShell 中的变量引用 $workflow:xx
问题描述
我在 PowerShell 5.1 中使用工作流,需要填充 $workflow:xx 其中 xx 是基于先前查询的动态
$test = @(1,2,3,4)
workflow my-test{
param(
$test
)
$1=1
$2=2
ForEach -Parallel ($num in $test){
$workflow:1 #works but not what I need
$workflow:$num #does not work
$workflow:${$num} #does not work
$workflow:${num} #does not work
}
$2
}
不是我问题的答案,但这是我的工作。
$test = @(1,2,3,4)
workflow my-test{
param(
$test
)
ForEach -Parallel ($num in $test){
write-output $num
}
}
#returns array of all responses
$response = my-test
解决方案
推荐阅读
- php - 是否可以转义这个 str_replace() 以进行路径遍历?
- python - 将包含字节数组的字符串转换为 uint16
- android - FirebaseFirestoreException:FAILED_PRECONDITION
- python - Python 意外行为
- razor-pages - 将多个图像 url 分配给存储在 sql server 数据库中的项目
- c# - 无法将类型“Microsoft.Office.Interop.Outlook.MAPIFolder”隐式转换为“Microsoft.Office.Interop.Outlook.Folder”
- java - 如何更改 ScheduledExecutorService 中的线程池大小?
- python - 在 imshow 上绘制一个 RGB 点
- java - 我们可以使用 powerbi rest 更改 powerbi 报告的内容吗
- android - IllegalAccessError:试图访问方法 com.google.common.io.Files.fileTreeTraverser()