How to Open PDF File Using PowerShell
Having ability to open PDF file from PowerShell is extremely useful. It can save you time and energy by allowing you to automate opening PDF files so we can avoid repetitive tasks.
In this article, we’ll walk through how to use PowerShell commands to open PDF file.
Once you are in PowerShell environment, you can type in
Start-Process followed by the path of your PDF file.
In this case, we are going to open PDF file that is physically located at
C:\Reports\Report1.pdf, you would type following script into PowerShell.
Start-Process command will launch the file immediately.
Another useful command is
Invoke-Item which can also be used to open specific file. To use this command, simply enter it followed by the path of the file.
This will automatically launch PDF file.
Using Call Operator (&)
& can also be used to open the file. The pattern is the same with previous example where the operator must be followed by the path of PDF file.
Using Windows PowerShell commands makes opening PDF file incredibly easy and efficient, just remember we can use
Invoke-Item or Call Operator
& command to open the application.