Azure Automation: Increase Azure IaaS VM disks w/PowerShell

Several months ago I have written two functions Get-AzVmDisk and New-AzVmDisk that are intended to retrieve disk info and create new data disks for Azure VM(s). Today to close the topic, we will talk about how to increase existing OS and Data disks. It will be Expand-AzVmDisk function. Expand-AzVmDisk The Expand-AzVmDisk function from my Azure … Continue reading Azure Automation: Increase Azure IaaS VM disks w/PowerShell

ps1Liner :: Add PowerCLi version to the $PSVersionTable variable

What is one-liner? This is just one line of code (PowerShell/PowerCLi or whatever) intended to perform particular task. It may be very or sometimes very-very long, but is still one line only! This one-liner adds PowerCLi version to $PSVersionTable environment variable. The technique described by Microsoft MVP Jeffery Hicks in this article. 1Liner Note, in … Continue reading ps1Liner :: Add PowerCLi version to the $PSVersionTable variable

Azure Automation: How to add a data disk to an Azure VM w/PowerShell

This article is about two new functions from my Azure Automation Az-Module - Get-AzVmDisk and New-AzVmDisk. The built-in Get-AzureRmVm cmdlet returns a VM object in the JSON format. The Get-AzVmDisk function gets this output and makes with it three actions: Cuts disks related data Parses this data Returns PowerShell like structured objects Get-AzVmDisk For multiple … Continue reading Azure Automation: How to add a data disk to an Azure VM w/PowerShell

How to find orphaned VHD files in the Azure IaaS cloud

When you delete a VM via Microsoft Azure portal, you don’t have an option to delete the VM related objects (virtual network interfaces and virtual disks as well) . Orphaned virtual disks - these are *.vhd files that reside on your StorageAccount(s) and consume expensive storage space, but are not related to any VM. As … Continue reading How to find orphaned VHD files in the Azure IaaS cloud

Azure Automation: How to stop/start Azure VM on schedule

To be cost-effective in any cloud-based environment you have as an option to shut down your VM in off-hours. In the Microsoft Azure IaaS you can stop (deallocate) and start your VMs on schedule with Automation Accounts. Apply-AzVmPowerStatePolicy.ps1 script With a PowerShell script Apply-AzVmPowerStatePolicy.ps1 from my Azure repo you will be able to build your … Continue reading Azure Automation: How to stop/start Azure VM on schedule

Put PowerShell scripts to sleep with Progress Bar

All of you know very well the embedded PowerShell cmdlet Start-Sleep, which able to put a script to the sleep for a certain period measured in seconds or milliseconds. This is great, but not enough. Start-SleepProgress The Start-SleepProgress function from my PowerShell MS-Module module has some enhancements compared to the usual Start-Sleep cmdlet. First of … Continue reading Put PowerShell scripts to sleep with Progress Bar

How to create colored and adjustable Percentage Bar in the PowerShell

In one of the scripts on GitHub I found interesting function Show-PercentageGraph, written by vmdude (Frederic MARTIN). I decided on basis of this function to develop my own more robust and adjustable function. I introduce to you the function New-PercentageBar that is part of MS-Module from my PowerShell repository. New-PercentageBar One of the powerful features … Continue reading How to create colored and adjustable Percentage Bar in the PowerShell