Trying to make it where powershell minimizes all windows, refreshes the desktop, then brings it back up. Thing is.. the desktop doesn't refresh after the windows minimize.
$shell = New-Object -ComObject "Shell.Application"
$shell.minimizeall()
start-sleep 1
$shell.sendkeys('{F5}')
start-sleep 1
$shell.undominimizeall()
exit
You can use this:
$shell = New-Object -ComObject Shell.Application
$shell.minimizeall()
start-sleep 1
$wsh = New-Object -ComObject Wscript.Shell
$wsh.sendkeys('{F5}')
start-sleep 1
$shell.undominimizeall()
exit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With