Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

getting just the Version from a Get-WMIObject

$
0
0

OK, back to the painful world of formatting output StormStorm

 

this line of code works.  

 

Get-ADComputer -Filter * -SearchBase "ou=mgh_workstations,dc=Acme,dc=org" | Where {$_.Name} | Select Name

 

It returns just the computer name.

 

 

This line of code also works

 

Get-WMIObject Win32_OperatingSystem | Where {$_.version -match "^6.1" | Select version }

 

But it returns the following.

 

SystemDirectory : C:\Windows\system32

Organization    : 

BuildNumber     : 7601

RegisteredUser  : MyUserID

SerialNumber    : 55041-011-3798877-86070

Version         : 6.1.7601

 

 

How come it lists so much?  how do I get just the version and nothing else?


Viewing all articles
Browse latest Browse all 8583

Trending Articles