Created
August 14, 2023 19:25
-
-
Save Anas-jaf/9218b46290c1a8602316816b16b3f46d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the path to the Firefox executable | |
$firefoxPath = "C:\Program Files\Mozilla Firefox\firefox.exe" | |
# Get a list of all PDF files in the current directory | |
$pdfFiles = Get-ChildItem -Path . -Filter *.pdf | |
# Loop through the list and open each PDF file with Firefox | |
foreach ($pdfFile in $pdfFiles) { | |
$pdfFilePath = $pdfFile.FullName | |
$escapedFilePath = "`"$pdfFilePath`"" # Escape path with quotes for spaces | |
Start-Process -FilePath $firefoxPath -ArgumentList $escapedFilePath | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment