Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure automation powershell, not work int input parameter


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?

like image 956
pasha Avatar asked Feb 05 '16 15:02

pasha


People also ask

How do I trigger an azure automation?

You can do this from right inside the Azure Portal. Locate your runbook, and in the left-hand menu, click on the “schedules” option. This will open up a “Schedule Runbook” option where we need to select two items, the schedule to use and the parameters to pass. Click on the first option.

What is automation account variables in Azure?

Automation variables are useful for the following scenarios: Sharing a value among multiple runbooks or DSC configurations. Sharing a value among multiple jobs from the same runbook or DSC configuration. Managing a value used by runbooks or DSC configurations from the portal or from the PowerShell command line.


1 Answers

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"
like image 120
pasha Avatar answered Oct 12 '22 22:10

pasha