Skip to content

Instantly share code, notes, and snippets.

@JeremyTBradshaw
Last active December 3, 2020 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeremyTBradshaw/72081ffa090c458e7a755fdda64db63c to your computer and use it in GitHub Desktop.
Save JeremyTBradshaw/72081ffa090c458e7a755fdda64db63c to your computer and use it in GitHub Desktop.
Quick fake certificate thumbprints (and Guid's)
# For documentation purposes, sometimes I need fake thumbprints (and Guid's).
function New-FakeThumbprint ([ValidateRange(1, 10)][int]$Count = 1) {
1..$Count | ForEach-Object {
(
1..40 | Foreach-Object {
Get-Random @('A', 'B', 'C', 'D', 'E', 'F', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
}
) -join ''
}
}
New-Alias -Name nft -Value New-FakeThumbprint
# .Example: nft 5 (outputs 5 fake thumbprints)
# While we're here, Guids:
function New-Guid ([ValidateRange(1, 10)][int]$Count = 1) { 1..$Count | Foreach-Object { [Guid]::NewGuid() } }
New-Alias -Name ng -Value New-Guid
# .Example: ng 5 (outputs 5 new Guid's)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment