≡ Menu

PowerShell: Minimize all windows

Have you ever got a requirement to minimize all windows on the desktop using powershell script? It is helpful when you want to give a pop-up message to user which should draw their immediate attention.

I came across this little tip while exploring shell.application com object. It has other useful functions like undominimizeall, cascade windows, and many other explorer functions.

$shell = New-Object -ComObject "Shell.Application"

You can also undo minimize all windows by using below code.

$shell = New-Object -ComObject "Shell.Application"

To see the clear functionality, add some delay between minimizeall() function and undominimizeall() function.

$shell = New-Object -ComObject "Shell.Application"
start-sleep -Seconds 5

Hope this helps… You can explore more functions of shell.application object by using below code snippet.

New-Object -ComObject "Shell.Application" | gm | select Name, MemberType
{ 3 comments… add one }

Leave a Comment