A desktop publishing application from Microsoft that focuses on page layout and graphic design.
The error is not coming from the conversion script itself. PowerShell is telling you it cannot find the script to run. This usually means you are not in the folder containing Convert-PubFileToPDF.ps1 or you did not specify its path.
First, check your current folder:
Get-Location
Then check whether the script is actually there:
Get-ChildItem Convert-PubFileToPDF.ps1
If the script is in the current folder, run it like this:
.\Convert-PubFileToPDF.ps1 -Filter "*.pub" -Recurse
If the script is in another folder, specify the full path, for example:
C:\Scripts\Convert-PubFileToPDF.ps1 -Filter "*.pub" -Recurse
This script also requires the desktop version of Microsoft Publisher to be installed, since it automates Publisher through COM. If Publisher is not installed, the script will fail when it tries to create the Publisher.Application object.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin