# Get a list of display devices using the "Display" class $displayDevices = Get-PnpDevice -Class "Display" # Select the first display device from the list $displayDevice = $displayDevices[0] # Disable the selected display device by its InstanceId Disable-PnpDevice -InstanceId $displayDevice.InstanceId # Wait for 3 seconds to allow the device to deactivate sleep 3 # Enable the previously disabled display device Enable-PnpDevice -InstanceId $displayDevice.InstanceId