Sometimes, we need to know the Operating system name and version for troubleshooting and sometimes we need to run specific code for specific version. With Powershell, this is very simple.
Hope, this was simple and useful for your scripts.
Enjoy scripting!!
$OS_VERSION=$(Get-WmiObject -Class Win32_OperatingSystem).Version $OS_NAME=$(Get-WmiObject -class Win32_OperatingSystem).Caption echo "Version : $OS_VERSION" echo "Version : $OS_NAME"
Hope, this was simple and useful for your scripts.
Enjoy scripting!!
No comments:
Post a Comment