Azure自动化PowerShell,而不是工作int输入参数

pas*_*sha 6 azure azure-powershell azure-automation


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

workflow Report
{
    param
    (
        [parameter(Mandatory=$True)]
        [string] $Name,

        [parameter(Mandatory=$true)]
        [Int] $MyCount
    )

    inlinescript
    {
       Write-Verbose "Name $Name"
       Write-Verbose "Count $MyCount"
    }
}
Run Code Online (Sandbox Code Playgroud)

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

Name Test
Count
Run Code Online (Sandbox Code Playgroud)

$名称工作正常,
但$ MyCount没有显示

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

我如何使用int输入参数?

pas*_*sha 1

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

Write-Verbose "Count $Using:MyCount"
Run Code Online (Sandbox Code Playgroud)