Dynamics Documentation PowerShell Downloader

A common issue I am always faced with these days is the ability to have some Dynamics CRM / D365 Documentation, offline.  I am always a fan of PDF documentation that I can carry with me on my iPad, and since Microsoft stopped providing the usual CHM files with the traditional SDK’s, I have been at a bit of a loss.

With the advent of the new Documentation site that Microsoft have moved everything to, they now provide you with a handy option to download chunks of the documentation in PDF format.  Brilliant.

However, I don’t want to have to go through all of the sections to manually download the documents, and of course, what if, and how often do you need to do this to keep your documentation up to date.

Well, stand by for the amazing Dynamics Documentation PowerShell Downloader.  It really is quite simple, and feel free to add as many other documents as you wish to the script.  You can of course also modify it to save it to a different folder by changing the folder at the top of the script.  This goes hand in hand with the Dev Tools downloader that I blogged about previously.  Although the previous Script was provided by Microsoft, this one is all me 🙂


# Change the variable folder to the location you wish to save the Documentation to
$folder = "c:\DevTools\Documentation"

# Add the documents you wish to download below, in the format "filename" = "URL";
$documents = @{ "Customer Engagement Admin Guide.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/admin/TOC.pdf?branch=live";
                "Customer Engagement Customisation Guide.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/customize/TOC.pdf?branch=live";
                "Customer Engagement Developer Guide.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/developer/TOC.pdf?branch=live";
                "Customer Service User Guide.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/customer-service/TOC.pdf?branch=live";
                "Unified Service Desk.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/unified-service-desk/TOC.pdf?branch=live";
                "Customer Engagement Portals Guide.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/portals/TOC.pdf?branch=live";
                "Customer Engagement Field Service Guide.pdf" = "https://docs.microsoft.com/en-gb/dynamics365/customer-engagement/opbuildpdf/field-service/TOC.pdf?branch=live";
                }


md $folder -ErrorAction Ignore
cd $folder

foreach ($h in $documents.Keys) {
    Write-Host "Downloading ${h}"
    Invoke-WebRequest $documents.Item($h) -OutFile $h
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.