How to Open a PDF from PowerShell
Open any local PDF from PowerShell with Invoke-Item or Start-Process, handle paths and errors, and automate PDF workflows safely on Windows.

Use Invoke-Item -LiteralPath to open a PDF with Windows’ default associated application:
Invoke-Item -LiteralPath 'C:\Users\Ava\Documents\report.pdf'
PowerShell performs the file’s default action. For a PDF on Windows, that normally means opening it in the application associated with the .pdf file type. Microsoft documents this behavior for Invoke-Item and the PowerShell shell model for associated document applications.
Open a PDF with Invoke-Item
Invoke-Item is the clearest command when you want the same result as double-clicking a file in Explorer.

# Exact path
Invoke-Item -LiteralPath 'C:\Reports\quarterly report.pdf'
# Relative path from the current directory
Invoke-Item -LiteralPath '.\quarterly-report.pdf'
# A path stored in a variable
$pdfPath = 'C:\Reports\quarterly-report.pdf'
Invoke-Item -LiteralPath $pdfPath
-LiteralPath treats the path exactly as written. That matters when a filename contains wildcard characters such as [ or ]. Quote paths containing spaces, apostrophes, parentheses, or other shell characters.
Resolve and validate the path first
$pdfPath = 'C:\Reports\quarterly-report.pdf'
if (-not (Test-Path -LiteralPath $pdfPath -PathType Leaf)) {
throw "PDF not found: $pdfPath"
}
Invoke-Item -LiteralPath $pdfPath
This check gives you a useful error before PowerShell attempts to launch a viewer. -PathType Leaf also prevents a directory from being passed accidentally.
Find a PDF, then open it
$pdf = Get-ChildItem -LiteralPath 'C:\Reports' -Filter '*.pdf' -File |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if ($null -eq $pdf) {
throw 'No PDF files were found.'
}
Invoke-Item -LiteralPath $pdf.FullName
Use -LiteralPath when you already know the directory. Use -Filter '*.pdf' with Get-ChildItem when you intentionally want a pattern.
Use Start-Process as an alternative
Start-Process also launches a non-executable document with its associated application, according to the Microsoft documentation.
Start-Process -FilePath 'C:\Users\Ava\Documents\report.pdf'
For a simple PDF, the two commands usually have the same visible result. Choose Start-Process when you are already building a process-oriented script or need options such as waiting for the launched process.
# Start the associated PDF application and return immediately
Start-Process -FilePath 'C:\Reports\report.pdf'
# Ask PowerShell to wait for the process it starts
Start-Process -FilePath 'C:\Reports\report.pdf' -Wait
Whether -Wait behaves as you expect depends on how the PDF application handles an existing instance. A viewer may hand the document to an already-running process and exit its launcher quickly.
Choose a specific PDF application
Invoke-Item and the basic Start-Process example use the local default association. They do not install a reader or select a particular brand. If you need a specific executable, pass that executable as -FilePath and the PDF as an argument.
$viewer = 'C:\Program Files\Example PDF Reader\Reader.exe'
$pdfPath = 'C:\Reports\report.pdf'
if (-not (Test-Path -LiteralPath $viewer -PathType Leaf)) {
throw "Viewer executable not found: $viewer"
}
if (-not (Test-Path -LiteralPath $pdfPath -PathType Leaf)) {
throw "PDF not found: $pdfPath"
}
Start-Process -FilePath $viewer -ArgumentList @($pdfPath)
Replace the example executable path with the path installed in your environment. Do not assume that a reader exists at a fixed location across machines.
Open PDFs from common PowerShell path forms
| Situation | Command |
|---|---|
| Path with spaces | Invoke-Item -LiteralPath 'C:\My Reports\final report.pdf' |
| UNC network path | Invoke-Item -LiteralPath '\\server\share\report.pdf' |
| Mapped drive | Invoke-Item -LiteralPath 'Z:\reports\report.pdf' |
| Current directory | Invoke-Item -LiteralPath '.\report.pdf' |
| Environment variable | Invoke-Item -LiteralPath (Join-Path $env:USERPROFILE 'Documents\report.pdf') |
| Path returned by Get-Item | Invoke-Item -LiteralPath (Get-Item -LiteralPath $pdfPath).FullName |
Automate opening several PDFs
$files = Get-ChildItem -LiteralPath 'C:\Reports' -Filter '*.pdf' -File
foreach ($file in $files) {
Invoke-Item -LiteralPath $file.FullName
}
Opening many files can create many tabs or windows, depending on the reader. If you only need to process files, use a PDF command-line tool or library instead of launching a graphical viewer; the commands here are for opening documents in an associated application.
PowerShell sessions, Windows, and remote hosts
These commands are most useful in an interactive Windows session with a desktop. Microsoft describes Invoke-Item‘s associated-document behavior specifically for Windows. In a server, container, scheduled task, SSH session, or other non-interactive host, there may be no graphical shell or PDF association to handle the request.
PowerShell 7 on Windows can use the same commands. Running PowerShell on Linux or macOS may resolve paths differently and cannot be assumed to provide Windows-style GUI opening behavior.
Troubleshooting
| Error or symptom | Likely cause | Fix |
|---|---|---|
Cannot find path |
The path is misspelled, relative to another directory, or the drive is unavailable. | Run Get-Location, use an absolute path, and verify with Test-Path -LiteralPath .... |
| Path with brackets opens incorrectly | A wildcard-aware parameter interpreted part of the filename. | Use quoted -LiteralPath, not -Path. |
| No application opens | No usable default application is associated with .pdf, or the host has no desktop. |
Set a Windows PDF default in system settings, specify a reader executable with Start-Process, or run in an interactive desktop session. |
| Access denied | Your account cannot read the file or the network share. | Check ACLs, share permissions, and whether the file is locked or encrypted. |
| Network PDF fails | The UNC path, VPN, drive mapping, or credentials are unavailable. | Test the path with Test-Path; use a UNC path or establish the connection in the same session. |
| Command returns before the PDF window appears | The viewer starts asynchronously or reuses an existing process. | Use Start-Process; add -Wait only when your workflow requires waiting. |
| PowerShell appears frozen | A viewer or network location is taking time to start. | Check the viewer process and network status; avoid opening large batches at once. |
Reliable scripting checklist
- Use absolute paths for scheduled jobs.
- Quote paths that contain spaces.
- Use
-LiteralPathfor exact filenames. - Validate with
Test-Path -PathType Leaf. - Log the path before launching when diagnosing automation.
- Expect GUI commands to fail or do nothing on headless hosts.
- Do not assume a particular PDF reader is installed.

Performance, reliability, and security notes
Launching a local PDF is normally limited by the viewer startup time, file size, antivirus scanning, and network latency for UNC paths. PowerShell itself does not render the PDF. For repeatable automation, validate the file, prefer local paths when possible, and handle missing files explicitly.
Opening an untrusted PDF can expose you to risks handled by the PDF application. Keep the viewer updated and use your organization’s file-handling policy. PowerShell commands shown here only start the associated application; they do not inspect or sanitize document content.
Or skip the browser setup
If your workflow starts with a web URL and you need a PDF or screenshot rather than opening an existing local file, ScreenshotNeo provides a website screenshot API and MCP server. Its API can return a PDF, while handling browser setup for you. See the ScreenshotNeo documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Cookie banners, newsletter popups, and chat widgets are removed before the shot. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.
Create a free ScreenshotNeo account to try it.
FAQ
Can I open a PDF without knowing its full path?
Yes. Use Get-ChildItem to locate it, select the matching file, then pass its FullName to Invoke-Item.
Does PowerShell include a PDF reader?
No. The commands rely on a Windows file association or an explicitly supplied viewer executable.
Should I use Invoke-Item or Start-Process?
Use Invoke-Item for the default action. Use Start-Process when you need process options or want to name a specific executable.
Will this work in a scheduled task?
Only if the task runs in an interactive Windows desktop with access to the file and an associated PDF application. Headless tasks generally cannot display a window.


