A desktop publishing application from Microsoft that focuses on page layout and graphic design.
Hi Ted,
Based on your sharing, there are two separate issues in your case: the downloaded script may need its .ps1 extension restored, while the Office.dll message means the required Microsoft Office/Publisher interop component is unavailable or the script is being run in the wrong PowerShell environment.
I suggest trying these steps:
- Open File Explorer and select View > Show > File name extensions.
- If the file is named only Convert-PubFileToPDF, rename it to Convert-PubFileToPDF.ps1 and save it in C:\PubConvert
- Confirm that the desktop version of Microsoft Publisher is installed and can open a .pub file.
- Open Windows PowerShell and run these commands one at a time (please note the backslash between PublisherFiles and *.pub):
cd C:\PubConvert
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Unblock-File .\Convert-PubFileToPDF.ps1
.\Convert-PubFileToPDF.ps1 -Filter "C:\PublisherFiles\*.pub" -Recurse
For reference: Microsoft Publisher will no longer be supported after October 2026 | Microsoft Support
If the error still says that C:\PubConvert\Office.dll cannot be found, repair the installed Office applications following the steps here: Repair an Office application | Microsoft Support. After the repair, restart the computer, verify that Publisher opens normally, and run the script again.
If you have any questions or need further support, please don’t hesitate to reach out again in the comments of this post. I'm happy to assist you further.