Estimated Reading Time: 2 minutes
There is no blog post in Why Azure from last one month and many people have contacted me for this. Actually, I was on vacation so didn’t get the time to write.
PowerShell on CloudShell is now available in GA and it was announced in the Ignite 2018, the interesting fact is that it’s running in a Linux Container but you can still be able to run all your cmdlets to do any operations in Azure.
The following are the improvements which you can find the Azure PowerShell.
Faster Start Time: PowerShell start time has improved a lot and now it can open less than 60 secs. (During the preview phase it took around 120 secs to open the PowerShell)
PowerShell Core: PowerShell core is now cross-platform and can run within a Linux Container.
Consistent tooling: Since PowerShell is running on Linux you will get consistent toolset experience. To get the list of tools available for the Azure PowerShell you can click here.
Azure VM remoting cmdlets: Azure VM remoting cmdlets, four new cmdlets which are Enable-AzVMPSRemoting, Disable-AzVMPSRemoting, Invoke-AzVMCommand, and Enter-AzVM. These cmdlets enable you to easily enable PowerShell Remoting on both Linux and Windows virtual machines using ssh and wsman protocols.
If you want to switch back to bash you don’t need to open another window and directly type the bash command
Just type bash and you can find the bash shell
And if you type exit you can go back to PowerShell
Now more new things, if you type the dir command you can see your subscription details
Now let’s see what you can do with Azure PowerShell new cmdlets, which has been introduced in GA
The first command to enable PS Remoting can be used in the following way.
Enable-AzVMPSRemoting -Name vmName -ResourceGroup resourceGroup
Once the PS Remoting is allowed on a VM you can remotely run the PowerShell command on that VM.
The 2nd command is to disable the PS Remoting
Disable-AzVMPSRemoting -Name VmName -ResourceGroup resourceGroup
The 3rd command is to Invoke the Azure VM, by using a single Invoke-AzVMCommand command, you can run commands on multiple computers remotely. (Invokes the given command on the list of given Azure VMs)
Invoke-AzVMCommand -Name WindowsVM -ResourceGroupName ResourceGroupName -ScriptBlock ScriptBlock -Credential credential
The 4th command is Enter-AzVM
The Enter-AzVM cmdlet starts an interactive session with a single Azure VM. During the session, the commands that you typically run on the Azure VM, just as if you were typing directly on the Azure VM. Please note that you can have only one interactive session at a time.
That’s all for today, I hope you will like this post.
Happy Diwali to all my friends and followers in India and around the world.