PoshTip #48 – Start a Process in a Minimized Window using PowerShell

The Start-Process cmdlet starts one or more processes on the local computer. So I can easily open a text file using the following command:

It works. But what about the window style? Just imagine you want to open the same text file in a minimized style?

Let’s take a look at information about the Start-Process cmdlet. Use the Get-Help cmdlet to check the available parameters:

As you can notice, there is a WindowStyle parameter that allows you to specify « Minimized » value (Default value is « Normal »). So Let’s try it:

You may notice that nothing appear except a new NotePad icon on the taskbar.

Note: Use tab expansion to bring up the available options for the « WindowStyle » parameter.

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 216 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 7 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSA: Windows Server 2012" and "Administering & Deploying SCCM" certified.