Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

PowerTip: Extend a string array in PowerShell

Summary: Use the built in features of PowerShell to easily add new Element to a string array. (image) I created an array of strings in PowerShell, but I need to add to it. Is there a simple way to do this? (image) Absolutely. Just use += to add an element to your string array. In the following example, we add a new element to the array that...

PowerTip: Export Azure resource group as JSON by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to export a resource group as a JSON configuration. (image) I’ve heard that JSON is used to define features in Azure Resource Manager. Is there a way to export a resource group in JSON format? (image) Just use the Export-AzureRMResourceGroup cmdlet and provide the resource group name. It ...

PowerTip: Search Azure Resource Manager image publishers by using PowerShell

Summary: Use the Azure Resource Manager cmdlets to search publishers for a match. (image) Could you show me an example of how to search through the list of publishers for Azure images? (image) Just use the Get-AzureRMVMImagePublisher cmdlet, and filter on the PublisherName property. The following example searches for all publishers that ...