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:
PS > Start-Process notepad.exe C:\Temp\TextFile.txt
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:
PS > Start-Process notepad.exe C:\Temp\TextFile.txt -WindowStyle Minimized
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