I’ve lost count of the number of times I’ve had the need to generate a representative dataset of users. Of course I have access to many production datasets but for many reasons they can’t be used. Finding previous datasets I’ve randomly generated always seems to take longer than it should, so with my most recent iteration of having to generate a fictitious list of users with Australian addresses, I’ve documented how I went about it, along with the source data I used and the script to create it.
For my data sources to base my dataset off, I wanted representative data for Australia for both people names and locations. After a few quick searches I found;
The script is pretty simple. It imports each of the CSV’s listed above and generates a random number based on the number of records in each file.
The GitHub Repo contains the PowerShell script along with the source files. Change line 3 for the location where you store the CSV files and change line 66 for the number of users to generate. I’ve left the end of the script empty. I either insert the API call to create the users, or the PowerShell cmdlet with the data to do the creation depending on where I’m creating the users.
Here is a sample output in JSON format.
{ "Street": "370 Miskin St", "Surname": "Burne", "Suburb": "WOODBROOK", "Postcode": "3451", "State": "VIC", "GivenName": "Miro" } { "Street": "293 Preston Rd", "Surname": "Partingale", "Suburb": "MARRARA", "Postcode": "812", "State": "NT", "GivenName": "Daniella" } { "Street": "409 Orchard St", "Surname": "Liaseyer", "Suburb": "THURGOONA", "Postcode": "2640", "State": "NSW", "GivenName": "Ariana" } { "Street": "775 Station Rd", "Surname": "Nevin", "Suburb": "AVON DOWNS", "Postcode": "862", "State": "NT", "GivenName": "Naria" }
Using data publicly available and PowerShell it is possible to quickly generate a dataset of representative users and addresses. Generating other attributes is as easy as extrapolating from the existing data or supplementing it with additional source data files.
A few weeks back the Microsoft AI Tour was in Sydney Australia. There was a…
If you're anything like me you always have PowerShell open, and often both PowerShell and…
Decentralised Identity is a technology I'm passionate about and have written many posts and tools…
Over two years ago I authored a PowerShell Module that enabled the automation of 1Password.…
Buried in my PowerShell Snippets Vol 4 post from 2021 is the PowerShell script and…
Short post on how to recovery from "The Windows Subsystem for Linux instance has terminated"…
This website uses cookies.
View Comments