Generate Manufacturer and Model Collections based on Inventory

Having Model & Manufacturer collections can be quite useful. Targeting Client settings based on Manufacturer, deploying BIOS / Drivers based on Model, having collections makes it a bit easier.
In the previous couple of posts, we talked about adding additional information into hardware inventory, well this script relies on those things being done.

So what is this script, what does it do, and why might I want it?

This script looks through your CM Site inventory, provides a list of Manufacturers and Models for you to choose from, once you've picked, it creates collections with queries to populate them.

Pre-Reqs

The Script should work out of box, but you can customize to fit your needs. You can change the PreFix on the Collection Names, which types of Collections you want made, and if you dig into the code a bit more, you can change the comments on the collections as well.  Creating this script helped me learn a lot about collection queries and setting up collections with PowerShell.
If you want to change the refresh times on the collections, look for the $Schedule and change that to fit your needs.

To change the refresh times on the collections, look for the $Schedule
Select the manufacturers
When you run the script, it will prompt for manufacturers.  Even if you don't plan to create any manufacturer collections, you need to pick the manufacturer for the models you with to create a collection for.
Select Strings
Select the HP Models you wish to create Collections
Select the LENOVO Models you wish to create Collections

Once you've picked the Models you want collections for, the script takes over and creates them.

Script creates Models you want collections for

If you pick a Model or Manufacturer to create a collection for, and there is already a collection by the same name, it will skip creation and let you know.

Skip Models or Manufacturers that already have collections

After the script completes, you can see the results in your console.

See the results in your console
Comments are included in the scripts, you can always modify or remove them.
The Script generates the Queries
The Script generates the Queries.
HP's are based on Baseboard.Product
Lenovo's are based on ComputerSystemProduct.Name

The Script is very dynamic. Feel free to bend to your needs, and look forward to Recast's Right Click Tools including more hardware related information in the Device Dashboard in upcoming releases.

Script available on GitHub