Created
June 22, 2020 12:22
-
-
Save techdecline/58ba1bfd2129715da612e839392e330d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function New-AzureUniqueName { | |
| param ($prefix,$NameLength = 24) | |
| $length = $prefix.length | |
| if ($length -ge $NameLength) { | |
| throw "Name prefix too long" | |
| } | |
| else { | |
| $fillUnique = ((New-Guid).toString() -replace "-","").Substring(0,($NameLength-$length)) | |
| } | |
| $kvName = $prefix + $fillUnique | |
| return $kvName | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment