Hello everyone,
I happen to use following command to obtain operating system version details.
cmd /ver
The same command cannot be used when called in a PowerShell script like following. Why? because it opens a shell; and control remain stuck there.
invoke-command -scriptblock {cmd /ver}
Now I have tried following but this is not very explanatory as I want details given from cmd /ver.
$Version = (Get-CimInstance Win32_OperatingSystem -ErrorAction Stop).Version
How can I obtain the Major/Minor/Version/Patch details using any PowerShell command on a remote machine where the output from cmd /ver is equivalent to output from PowerShell command.
Output of cmd /ver
Microsoft Windows [Version 10.0.19044.2486]
(c) Microsoft Corporation. All rights reserved.
[Version 10.0.19044.2486] <---- is the details required via PowerShell, (meaning the numbers)
Output of Get-CimInstance Win32_OperatingSystem
10.0.19044
Any help would be appreciated.
Nitin.