kaeaddaar / TaskAndActivity

Task and Activity Project
0 stars 0 forks source link

PowerShell - 40645 Servername exception #5

Open kaeaddaar opened 7 years ago

kaeaddaar commented 7 years ago

New-AzureRmSqlServer : 40645: Servername "SqlServer1" cannot be empty or null. It can only be made up of lowercase letters 'a'-'z', the numbers 0-9 and the hyphen. The hyphen may not lead or trail in the name. At C:\Users\playi\Documents\GitHub\TaskAndActivity\Infrastructure\CreateSQL\CreateSqlServer.HowTo.ps1:14 char:1

kaeaddaar commented 7 years ago

Link to code at point of issue: https://github.com/kaeaddaar/TaskAndActivity/blob/b195ddae7ca90377053bc6fab63b2875e81d6a2e/Infrastructure/CreateSQL/CreateSqlServer.HowTo.ps1 Link to current version of code: https://github.com/kaeaddaar/TaskAndActivity/blob/master/Infrastructure/CreateSQL/CreateSqlServer.HowTo.ps1

Failed on lowercase letters limitation Limitations for name: Lower case a-z numbers 0-9

Research: https://stackoverflow.com/questions/2098485/check-string-for-all-lowercase-letters-in-powershell?rq=1

Test originally created: https://github.com/kaeaddaar/TaskAndActivity/commit/b195ddae7ca90377053bc6fab63b2875e81d6a2e

Test as it is now: https://github.com/kaeaddaar/TaskAndActivity

Fix: Perform a .ToLower() to prevent lower case problems

To do: Confirming that the letters follow the three allowable patterns