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.
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.
Assign Get-CimInstance -ClassName ... to a variable.
Loop through all objects (in case a system has more than one controller) using foreach() or ForEach-Object{} and within it:
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.