If all you need to do is minimizing all open windows, there is the Shell.Application COM object. PowerShell can access its methods via New-Object:
$shell = New-Object -ComObject Shell.Application $shell.MinimizeAll() Start-Sleep -Seconds 2 $shell.UndoMinimizeALL()
This sample minimizes all open application windows, waits for two seconds, and restores them all.