timpringle

Explore articles and content from this author

timpringle

3 articles published

1 min read

Using PowerShell to make Azure Automation Graphical Runbooks – Part 2

The previous article in this series covered the release of the Microsoft Azure Automation Graphical Authoring SDK, and began to outline some of the classes used and, where possible, the visible elements they relate to in the Azure portal itself. This second part of the series focuses on probably the most time consuming and challenging part of scripting these runbooks, those to do with Activities. You can read the full article at www.

1 min read

Using PowerShell to make Azure Automation Graphical Runbooks – Part 1

Microsoft recently released another extension for Azure Automation developers, this time in the form of the Microsoft Azure Automation Graphical Authoring SDK. This SDK allows developers to make and edit graphic runbooks for using in Azure Automation. Although the examples given are in C#, it’s possible to apply the same methodologies to develop them in PowerShell with the accompanying SDK mentioned above. You can read the first article of this series on creating these Graphical Runbooks at powershell.

1 min read

Using Local Functions in a Scriptblock with Existing Code

When you are wanting to run code remotely, it’s common to do this via the use of Invoke-Command (though other options exist, such as through Start-Job for example). The biggest downfall to date i’ve found with remoting is the lack of an option to combine the use of your local functions within a ScriptBlock that has other code in it. As an example, the following is not possible: function Add ($param1, $param2) { $param1 + $param2 } function Multiply($param1,$param2) { $param1 * $param2 } Invoke-Command -ComputerName $env:COMPUTERNAME -ScriptBlock { $addResult = Add $args[0] $args[1] $multiplyResult = Multiply $args[0] $args[1] Write-Output "The result of the addition was : $addResult" Write-Output "The result of the multiplication was : $multiplyResult" } -ArgumentList 3, 2 However, there is a way to achieve this type of operation, and make as many local functions as you want available to be used and combined with other code in your ScriptBlock.