Duplicate display with certain hardware installed - Windows 10

Welcome Forums General PowerShell Q&A Duplicate display with certain hardware installed - Windows 10

Viewing 2 reply threads
  • Author
    Posts
    • #192454
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      I am after help with Powershell, I am after something that does this wmic path win32_VideoController and when NVIDIA Geforce GT 710 is returned then runs this Displayswitch.exe /clone

      I am looking to push this via SCCM. Any help would greatly be appreciated.

    • #192475
      Participant
      Topics: 9
      Replies: 37
      Points: 163
      Helping Hand
      Rank: Participant

      I'd start with reading the help files on these cmdlets: Get-WmiObject and Start-Process.

    • #192616
      Participant
      Topics: 10
      Replies: 118
      Points: 504
      Helping Hand
      Rank: Major Contributor

      Great suggestion on the help files Darwin... but I do suggest looking up Get-CimInstance instead of Get-WmiObject as it's a more modern approach.

      1. Assign Get-CimInstance -ClassName ... to a variable.
      2. Loop through all objects (in case a system has more than one controller) using foreach() or ForEach-Object{} and within it:
        1. If the Caption (or Name) matches the NVIDIA string, then invoke the Start-Process cmdlet as per Darwin's suggestion.

      You could also use the & call operator as an alternative to Start-Process but you'll need to read up on it especially about its inability to parse strings for the arguments.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.