Question to PowerShell

Welcome Forums General PowerShell Q&A Question to PowerShell

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
1 year, 1 month ago.

  • Author
    Posts
  • #97731

    Participant
    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    Hi all,

    I have one issue, i build this code in powershell

    gwmi win32_computersystem | Select-Object -Property Devicename,Driverversion, Manufacturer, Model
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*Bios*"}
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*Wireless*"}
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*HD Graphics*"}
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*Realtek High*"}
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*Ethernet*"}
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*Camera*"}
    gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {$_.DeviceName -like "*Sierra*"}

    and my issue is when i try convert this all information to .CSV the file is all black can you help me for resolved my issue?
    The objective is catch all this information and put in sharepoint it's possible or not?

  • #97740

    Participant
    Topics: 3
    Replies: 66
    Points: 1
    Rank: Member

    "Tis should get you going

     gwmi Win32_PnPSignedDriver | select Devicename,Driverversion, Manufacturer | where {
     $_.DeviceName -like "*Bios*" -or
     $_.DeviceName -like "*Wireless*" -or
     $_.DeviceName -like "*HD Graphics*" -or
     $_.DeviceName -like "*Realtek High*" -or
     $_.DeviceName -like "*Ethernet*" -or
     $_.DeviceName -like "*Camera*" -or
     $_.DeviceName -like "*Sierra*" }| export-csv g:\test.csv
    
    • #97743

      Participant
      Topics: 1
      Replies: 1
      Points: 0
      Rank: Member

      Thanks that's works :D.
      Can you tell me if when i export this information to csv i can put online in sharepoint automatically?

  • #97768

    Participant
    Topics: 2
    Replies: 437
    Points: 875
    Helping Hand
    Rank: Major Contributor

    You can shorten the above with a bit of regex:

     Get-WmiObject -Class Win32_PnPSignedDriver | Select-Object Devicename, Driverversion, Manufacturer | 
        Where-Object {
            $_.DeviceName -match "Bios|Wireless|HD Graphics|Realtek High|Ethernet|Camera|Sierra" 
        } | Export-Csv -Path 'g:\test.csv'

The topic ‘Question to PowerShell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort