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
    • #192454
      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
      Topics: 10
      Replies: 46
      Points: 278
      Helping Hand
      Rank: Contributor

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

    • #192616
      Topics: 11
      Replies: 132
      Points: 903
      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
  • The topic ‘Duplicate display with certain hardware installed – Windows 10’ is closed to new replies.