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
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.
With PDQ Deploy open, click on Package Library.
In the Filter field, enter Git to narrow down the search results.
Select Git for Windows, and click Download Selected (As Auto Download).
Once the package downloads to your console, right-click on it, then click Deploy Once.
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.
Click Deploy Now when you are ready to deploy the package.
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
This Git command creates 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, 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.
# 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.
With PDQ Inventory open, click File > Import. This will open a File Explorer window.
Browse to the location where you cloned the PowerShell-Scanners repo. By default, the location should be C:\PowerShell-Scanners.
Open the PowerShell-Scanners folder located inside C:\PowerShell-Scanners.
Open the folder of the scanner you want to import. (For this example, I'll use the DNS Servers scanner.)
Select the Scan Profile.xml file and click Open.
You should receive a prompt that says "Import Complete". Click Close.
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.
Right-click All Computers, then click Scan Collection > Scan Profile Name (PS - DNS Servers in my example.
The scan status reflects the current progress of the scan.
Once the scan is complete, double-click on any of the scanned devices, then click on the PowerShell menu item.
Lastly, click on the drop-down menu button and select the correct scan profile to view the results.
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.