Skip to main content
PDQ.com mobilePDQ.com desktop
Support
Try Now

Powerup your PowerShell scanners with Git

Brock BinghamBrock Bingham
·

There's something magical about taking something good and making it great. Twinkies? Good. Deep-fried Twinkies covered in powdered sugar? Amazing. Perhaps a more relevant example of making awesome things even more awesome is when you combine PDQ Inventory's PowerShell Scanners with GitHub. What makes this a match made in heaven, and how can you take advantage of it? Let's find out!

What are Git and GitHub?

To understand what GitHub is, you first need to understand what Git is. 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. Anyways, Git was created as a way for developers to collaborate on projects while maintaining versioning 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 master branch.

GitHub, on the other hand, 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. GitHub also 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 are taking advantage of Git and GitHub's features. In fact, Microsoft thought GitHub was such a useful platform that they acquired it in 2018 for $7.5 billion.

Expanding your scanner library With Git and GitHub

One of the ways PDQ.com utilizes GitHub is by hosting Git repositories dedicated to providing expanded functionality in PDQ Deploy and PDQ Inventory. The great thing about these repositories is that they are open to the public, which enables our super-smart users to submit their own useful additions to the repositories.

One of the repositories we host on GitHub is the PowerShell-Scanners repository, which contains dozens of useful PowerShell scanners that can be imported into PDQ Inventory. Let's take a look at how we can use Git to clone the repo onto our local machine.

The first thing we need to do is install Git on our machine. Luckily, PDQ Deploy has a pre-built 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.

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

  4. Once the package finishes downloading, right-click on it and select Deploy Once.

  5. Enter the target machine for this deployment and 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.

Once Git has been installed, we can use it to clone the PowerShell Scanner repo using a simple, one-line Git command.

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

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

If you want to update your local copy of the repository in the future, Git makes it super easy by using the following command:

cd C:\PowerShell-Scanners
git pull

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.exe. The readme files describe what the scanners do. For example, if I browse out to C:\PowerShell-Scanners\PowerShell Scanners\DNS Servers and open up the README.md file, here's the information it gives me about the DNS Servers scanner.

# 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.

Importing scanners into PDQ Inventory

Now that we have our PowerShell-Scanners repository cloned, we can import the scanners into PDQ Inventory. If you 

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

  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.

  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.

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

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

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.

  2. You'll see the scan status reflect the current progress of the scan.

  3. To view the scan results, once the scan is complete, double-click on any of the scanned devices, then click on the PowerShell menu item.

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

Wrapping Up

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 be added 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 will guide you through the process.

Ready to put the PowerShell Scanner through its paces?

Take our 14-day Free Trial. Feel the power of the PowerShell scanner.
Start a Trial

Don't miss the next post!

Press Release: PDQ Acquires SmartDeploy

PDQ.com, a leading provider of IT asset management software, announced today its acquisition of SmartDeploy, an industry leader in remote computer management.

PDQ.com
© 2022 PDQ.com Corporation
Products
  • PDQ Deploy ®
  • PDQ Inventory ®
  • SimpleMDM
  • Pricing
  • Downloads
  • Licensing
  • Buy