Skip to content

Expand your PowerShell scanners with Git

Brock Bingham candid headshot
Brock Bingham|Updated May 21, 2024
git
git

Git is the world's most popular versioning control system, helping teams and communities collaborate on projects. It can also be a bit … user-unfriendly if it’s your first time using it. But that won’t stop us. Stick with me and I’ll show you how PDQ uses GitHub, a cloud-based Git service, to host the PowerShell-Scanners repository, which you can — and should — use to maximize the functionality of PDQ Inventory.

Not a PDQ customer? No worries. Try PDQ Inventory free for 14 days. Once you’ve got it installed, you can follow along with the rest of the article.

Git and GitHub

git1

Git is an open-source, distributed versioning control system developed by Linus Torvalds. If that name rings a bell, that's because he's the primary developer behind the Linux kernel. Yeah, he's kind of a big deal.

Torvalds created Git as a way for developers to collaborate on projects while maintaining version control and historical records. Focused on speed, simplicity, and a distributed design, Git makes it easy for developers all over the world to contribute to projects without the fear of accidentally altering a main branch.

GitHub is a cloud-based Git repository hosting service. While Git is traditionally managed from a command-line interface, GitHub provides a simple, intuitive graphical web interface to manage Git repositories. Alright, maybe “simple” and “intuitive” are a bit of a stretch.

GitHub layers in additional features to simplify collaboration, access controls, forking, pull requests, and merging. GitHub's functionality has made it a very popular platform, and not just for developers. A diverse collection of project types now takes advantage of the features of Git and GitHub. In fact, Microsoft thought GitHub was such a useful platform that it acquired the platform in 2018 for $7.5 billion. Meanwhile, I’m still waiting on Microsoft to make an offer for my “Jump to Conclusions” mat.

Expanding your PowerShell Scanner library with Git

PDQ hosts several public Git repositories on GitHub that people are free to use and contribute to. The PowerShell-Scanners repository specifically is designed to help users expand their PowerShell Scanner libraries. Included are dozens of useful PowerShell Scan Profiles that I’ll show you how to add to PDQ Inventory using Git. The best part is you don’t actually need to know PowerShell to follow along or use the prebuilt scanners.

Install Git

The first thing we need to do is install Git. Luckily, PDQ Deploy has a prebuilt Git package that we can use to make this step super easy.

  1. With PDQ Deploy open, click on Package Library.

  2. In the Filter field, enter Git to narrow down the search results.

    git2
  3. Select Git for Windows, and click Download Selected (As Auto Download).

    git3
  4. Once the package downloads to your console, right-click on it, then click Deploy Once.

    git4
  5. Enter the target machine for this deployment, then click Add Computer. Since I'm installing it locally, I've entered the localhost address 127.0.0.1.

  6. Click Deploy Now when you are ready to deploy the package.

    git5

Cloning the GitHub PowerShell-Scanners repo with Git

Once you've installed Git, we can use it to clone the PowerShell-Scanners repo using a one-line Git command.

git clone https://github.com/pdq/PowerShell-Scanners.git C:\PowerShell-Scanners
git7

This Git command creates a copy of the repo onto the root of your C: drive.

git6

If you want to update your local copy of the repository in the future, use this Git command.

cd C:\PowerShell-Scanners git pull

Scanner review

Before you start importing scanners into PDQ Inventory, I recommend browsing through the list of scanners you just cloned from the repo. Each scanner is organized into its own folder, and each folder contains a README.md file, which can be opened with Notepad. The README files describe what the scanners do. For example, if I browse to C:\PowerShell-Scanners\PowerShell Scanners\DNS Servers and open the README.md file, here's the information it gives me about the DNS Servers scanner.

git10
# Instructions [How to use this repository](../../README.md) # Description Retrieves the list of DNS servers the target is configured to use. # Author Colby Bouma

Browsing through the available scanners and reading their README files will give you an idea of how you can best utilize the scanners from the repo.

How to import PowerShell Scanners into PDQ Inventory

With the PowerShell-Scanners repository cloned, we’re ready to import the scanners into PDQ Inventory.

  1. With PDQ Inventory open, click File > Import. This will open a File Explorer window.

    git8
  2. Browse to the location where you cloned the PowerShell-Scanners repo. By default, the location should be C:\PowerShell-Scanners.

  3. Open the PowerShell-Scanners folder located inside C:\PowerShell-Scanners.

    git9
  4. Open the folder of the scanner you want to import. (For this example, I'll use the DNS Servers scanner.)

  5. Select the Scan Profile.xml file and click Open.

    git11
  6. You should receive a prompt that says "Import Complete". Click Close.

    git12
  7. To view your new scan profile, click the Scan Profiles button.

    git13

Using imported scanners

With our new scan profile imported, we can run it just like any of the built-in scan profiles.

  1. Right-click All Computers, then click Scan Collection > Scan Profile Name (PS - DNS Servers in my example.

    git14
  2. The scan status reflects the current progress of the scan.

    git15
  3. Once the scan is complete, double-click on any of the scanned devices, then click on the PowerShell menu item.

    git16
  4. Lastly, click on the drop-down menu button and select the correct scan profile to view the results.

    git17git18

PDQ Inventory and Git: Better together

Git and GitHub are changing the way people collaborate on projects. And while learning these systems can seem daunting at first, once you get past the basics, you'll find these platforms offer a lot of functionality that you can utilize to enhance your next project's workflow.

To make the most of the PowerShell-Scanners repository, make sure you update your local copy frequently. New content is being added all the time. When you're ready, consider submitting your own super cool custom scanner to the PDQ PowerShell-Scanner repository. Submitting your own scanner is a great way to help out the community and get your work recognized. If you need help submitting your scanner, check out our PowerShell Scanners webcast that guides you through the process.

Brock Bingham candid headshot
Brock Bingham

Born in the '80s and raised by his NES, Brock quickly fell in love with everything tech. With over 15 years of IT experience, Brock now enjoys the life of luxury as a renowned tech blogger and receiver of many Dundie Awards. In his free time, Brock enjoys adventuring with his wife, kids, and dogs, while dreaming of retirement.

Related articles