6


I use azure automation,
and have code like this

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

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

    inlinescript
    {
       Write-Verbose "Name $Name"
       Write-Verbose "Count $MyCount"
    }
}

in Test pane (on https://portal.azure.com) I set next value for this parameters: "Test" and 2
In console I see next result:

Name Test
Count

$Name working good
but $MyCount not showed

According to documentation I'm doing everything right
https://technet.microsoft.com/en-us/library/hh847743.aspx

How I can use int input parameter?

juvchan
  • 6,113
  • 2
  • 22
  • 35
pasha
  • 566
  • 5
  • 19

2 Answers2

1

according this post https://technet.microsoft.com/en-us/library/jj574197.aspx
in inlinescript I don't have access to main variables
for get main variable I need use $Using

Write-Verbose "Count $Using:MyCount"
Taras Kovalenko
  • 2,323
  • 3
  • 24
  • 49
pasha
  • 566
  • 5
  • 19
0

I had a similar issue, I noticed that my runbook type had to be "PoweShell Workflow Runbook" under Other.

When I had selected just PowerShell none of my parameters would appear in my Test pane

devopsdina
  • 54
  • 3