Today I needed to generate a bunch of test data in a hurry. How about using SMLets for that!?
No problem! In fact that is part of why we created SMLets was to do data generation for tests quickly and easily.
Here is an example of how to do it using the New-SCSMObject to create some incidents.
The PropertyHashtable takes a Hashtable as a value. In this case I am creating the hashtable right there inline but it could be passed as a variable too. All you need to do here is use the PropertyName on the left hand side of each hashtable pair and a value on the right hand side. Separate each pair in the hashtable using a semi colon. More information on creating hashtables in PowerShell can be found here:
This is what it looks like all put together:
On my test system it took about 45 seconds to create 1000 incidents this way. Nice!