Skip to content

Commit

Permalink
Merge pull request #170 from theohbrothers/docs/add-faq-on-how-to-ins…
Browse files Browse the repository at this point in the history
…tall-pandoc-so-that-it-is-correctly-set-in-path

Docs: Add FAQ on how to install Pandoc so that it is correctly set in `PATH`
  • Loading branch information
leojonathanoh committed Aug 3, 2023
2 parents 520261f + cdbd846 commit d3e6556
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ConvertOneNote2MarkDown-v2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Function Validate-Dependencies {
}

# Validate dependencies
if (! (Get-Command -Name 'pandoc.exe') ) {
throw "Could not locate pandoc.exe. Please ensure pandoc is installed."
if (! (Get-Command -Name 'pandoc.exe' -ErrorAction SilentlyContinue) ) {
throw "Could not locate pandoc.exe. Please ensure pandoc is installed for all users, and available in PATH. If pandoc was just installed using .msi or chocolatey, you may need to restart Powershell or the computer for pandoc to be set correctly in PATH."
}
}

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ The powershell script `ConvertOneNote2MarkDown-v2.ps1` will utilize the OneNote

* Microsoft Word >= 2016 (To be clear, this is the Desktop version NOT the Windows Store version. Can be installed with [Office 365 Trial](https://www.microsoft.com/en-us/microsoft-365/try)

* [PanDoc >= 2.11.2](https://pandoc.org/installing.html)

* Note: You may also use [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe) to install the [Pandoc package](https://chocolatey.org/packages/pandoc) on Windows, which will set the right path (environment) statements.
* [Pandoc >= 2.11.2](#q-how-to-install-pandoc)

## Usage

Expand Down Expand Up @@ -165,6 +163,15 @@ To uninstall after your are done converting, simply delete the `C:\PowerShell-7.

A: Powershell `7.1.x` and above no longer supports loading Win32 GAC Assemblies, which is needed for interacting with the OneNote Desktop APIs. It is very unlikely that Microsoft will add support for later Powershell Core versions, since Win32 is starting to become deprecated.

### Q: How to install Pandoc?

A: Pandoc can be installed in any of the following ways:

* Download [pandoc Windows `.msi` installer](https://pandoc.org/installing.html). During installation, ensure **Pandoc is installed for all users** (by checking the box `Install for all users of thie machine`), which is needed for Pandoc to be available to Administrator.
* Use [Chocolatey](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe) to install the [Pandoc package](https://chocolatey.org/packages/pandoc) on Windows.

After installing, ensure to **restart Powershell or the computer** for Pandoc to be set correctly in `PATH`.

### Q: Error(s) when opening OneNote as Administrator

A: If there are errors opening OneNote as Administrator, just open it normally without Administrator permissions. A user has reported successful conversion with only Powershell opened as Administrator. See [case](https://github.com/theohbrothers/ConvertOneNote2MarkDown/issues/149#issuecomment-1418051753).
Expand Down

0 comments on commit d3e6556

Please sign in to comment.