Duplicate display with certain hardware installed - Windows 10

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.

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

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.