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

Trouble parsing WMI output

$
0
0

Hi, 

I would really appreciate some help on this as well as a resource recommendation where i can learn this stuff...

 

$OS=Get-WmiObject -ComputerName ROS420DVAPP01V -Class Win32_OperatingSystem | Select Name

$OS.name contains

Microsoft Windows Server 2003 R2 Standard Edition|C:\WINDOWS|\Device\Harddisk0\Partition2

I really need to just grab everything before  the 1st "|" into the $OS variable,

 

Thank you

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles