Tushar Raichand
Tushar Raichand

Reputation: 61

How to find out what version of windows is Azure VM using, with powershell?

What is the command to check windows version in Azure VM. For ex Windows Server 2016.

Upvotes: 1

Views: 4399

Answers (2)

4c74356b41
4c74356b41

Reputation: 72171

Azure is not aware of the OS in your VM only os type (linux\windows). if you are using a custom image - you have to know whats inside the image. another option is to use Invoke-AzVmRunCommand to run powershell script inside vm that will return os version. something like $PSVersionTable should do.

Upvotes: 1

Joy Wang
Joy Wang

Reputation: 42063

Try to use (Get-AzVM -ResourceGroupName joywebapp -Name joyVM).StorageProfile.ImageReference.

Upvotes: 0

Related Questions