Powershell "join" -
Call me stupid, but I'm losing my hair with this.
I have two results from Get-WMIObject:
$ cpu = Get-WMIObject -Class Win32_Processor $ mb = Get-WMIObject -Class Win32_BaseBoard
< / Pre>Now, I can filter and produce a CSV file from each one:
$ cpu | Select the name of the object, the details. Convertro-csv-nautifikation
and
$ mb | Selection Item Manufacturer, Product | Converto-CSV-nautifikation
But ... How can I make a CSV output from both hell and both of these outputs? Something like this:
((cpu | the name of the object, choose details) + ($ mb | object-producing product, product)). (I.e., this syntax is invalid, to show the dot)
You need Powershell V2 for the following.
$ cpu = Get-WMIObject -Class Win32_Processor $ mb = Get-WMIObject -Class Win32_BaseBoard $ props = @ {name = $ cpu.Name Description = $ cpu.Description creator = $ mb. Manufacturer Product = $ mb.Product} New Object PSObject -Property $ props | ConvertTo-Csv-NoTypeInformation
Comments
Post a Comment