Azure 自动化 powershell,而不是 work int input parameter




我使用Azure自动化,
并有这样的代码

workflow Report
{
    param
    (
        [parameter(Mandatory=$True)]
        [string] $Name,
        [parameter(Mandatory=$true)]
        [Int] $MyCount
    )
    inlinescript
    {
       Write-Verbose "Name $Name"
       Write-Verbose "Count $MyCount"
    }
}

在测试窗格(https://portal.azure.com(中,我为此参数设置了下一个值:"测试"和 2
在控制台中,我看到下一个结果:

Name Test
Count

$Name运作良好
但$MyCount没有显示

根据文档,我做的一切都是正确的
https://technet.microsoft.com/en-us/library/hh847743.aspx

如何使用 int 输入参数?

根据这篇文章 https://technet.microsoft.com/en-us/library/jj574197.aspx
内联脚本中,我无法访问主要变量
为了获取主变量,我需要使用$Using

Write-Verbose "Count $Using:MyCount"

我遇到了类似的问题,我注意到我的运行手册类型必须是"其他"下的"PoweShell 工作流运行手册"。

当我只选择了PowerShell时,我的任何参数都不会显示在我的"测试"窗格中

最新更新