Azure Powershell Commands

Anish Antony
5 min readJan 18, 2023

Here let's explore different PowerShell commands to manage the Azure platform.

Photo by Athul Cyriac Ajay on Unsplash

1. Creating Variables in Powershell

It can define a variable in PowerShell using the $ symbol followed by the name of the variable. In the below example, the variable $myfirstvar is assigned with the string “Hello World”

$myfirstvar =  "Hello World"

Going forward, we will see the different variable assignments as part of different azure operations.


Splatting is a PowerShell feature that allows you to bundle up the parameters you want to supply to a command and pass them in a table, rather than one long line of code. With PowerShell splatting, your commands can be easier to read and navigate.

Lets see an example of this,

Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf -Force

The above example shows copying a text file from source to destination. Here with the Copy-Item command, it passes three parameters Path, Destination, and WhatIf. If there are more parameters, then you want to add it with the command. Here the problem is as the parameter increases, readability become more difficult and the user cant reuse a set of parameter for another command. Splatting can solve…



Anish Antony

Fullstack Developer | Blogger | Experience on Java, Python, React, Angular, Golang |