Scripting Blog [archived]

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

PowerTip: Get all Azure Resource Manager resource groups with PowerShell

Summary: Using the AzureRM cmdlets to get a list of resource groups. (image)  I have a client who has a large list of resource groups. Can you show me how to get a filtered list? (image)  Just use the Get-AzureRMResourceGroup cmdlet and pipe the results to Where-Object. To identify all resource groups that start with HSG in the name, try ...

PowerTip: Specify that a script requires admin privileges to run

Summary: Learn how to require admin privileges to run a Windows PowerShell script. (image)  How can I make sure that my Windows PowerShell script has administrator privileges to run? (image)  Use the #Requires directive and specify RunAsAdministrator. Here is an example: (image...