Combining PDFs with PDFTK Into a Folder by Year and Month

2018-11-25 16:15:06 +0000 - Written by Carl Burks

Learning PowerShell

First downloading the Language Specification from Microsoft will give you a good start into how to use PowerShell.


In PowerShell a comment begins with the octothorpe #

# This is a comment it doesn't actually do anything it just lets you write notes.

In the language specification you can read about comments in the section 2.2.3.

Getting help

You might read section 13.19 in the Language Specification to learn about how to get help, or run in PowerShell


Control of Flow

Control of Flow is how your program runs. Wikipedia does a pretty good job of explaining it.

Here is a PowerShell Specific explanation:


To learn about loops read here:

Commands Used

Special Variables

Sometimes you want to use “My Documents” from PowerShell.

Here is how to use that:


Want to learn more:


O’Reily has a book called PDF Hacks and they have a website for the book.

One of the tools described is PDFTK.

This is a great tool to learn for manipulating PDFs.

PDFLabs has the manpages for using the tool here.

Here is the download page:

When you install it, don’t uncheck the add to path button. We will need it in the path for the example script.

Putting them together

Here is a script:

The script will give you a warning telling you to only run scripts you trust. Running a script from the internet can be dangerous. It is important to read and understand what the script is doing before attempting to run it.

The script has been commented for ease of use of someone not familiar with PowerShell.

You can view it in VS-Code or PowerShell ISE which is built in.