Reputation: 61
What is the command to check windows version in Azure VM. For ex Windows Server 2016.
Upvotes: 1
Views: 4399
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
Reputation: 42063
Try to use (Get-AzVM -ResourceGroupName joywebapp -Name joyVM).StorageProfile.ImageReference
.
Upvotes: 0