From 94096ef2e3865e66fa3984d5a86e32005b43cf29 Mon Sep 17 00:00:00 2001 From: Bill Gibson Date: Tue, 27 Jun 2017 10:31:31 -0700 Subject: [PATCH] Modifying UserConfig to simplify user update and enforce lower case convert on user value --- Learning Modules/UserConfig.psm1 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Learning Modules/UserConfig.psm1 b/Learning Modules/UserConfig.psm1 index 8ae1241..f8df585 100644 --- a/Learning Modules/UserConfig.psm1 +++ b/Learning Modules/UserConfig.psm1 @@ -1,24 +1,27 @@ <# .SYNOPSIS - Returns the User name and resource group name used during the WTP application deployment. + Returns the User name and resource group name used during the Wingtip SaaS application deployment. The values defined here are referenced by the learning module scripts. #> -function Get-UserConfig { - $userConfig = @{` - ResourceGroupName = "" # the resource group used when the WTP application was deployed. CASE SENSITIVE - Name = $("".ToLower()) # the User name entered when the WTP application was deployed - } +## Update the two variables below to the values used when the Wingtip SaaS app was deployed. +$ResourceGroupName = "" # the resource group used when the Wingtip SaaS application was deployed. CASE SENSITIVE +$User = "" # the User value entered when the Wingtip SaaS application was deployed +## DO NOT CHANGE VALUES BELOW HERE ------------------------------------------------------------- - ## DO NOT CHANGE VALUES BELOW HERE ------------------------------------------------------------- +function Get-UserConfig { + $userConfig = @{` + ResourceGroupName = $ResourceGroupName + Name = $User.ToLower() + } if ($userConfig.ResourceGroupName -eq "" -or $userConfig.Name -eq "") { - throw '$userConfig.ResourceGroupName and $userConfig.Name are not set. Modify both values in UserConfig.psm1 and try again.' + throw 'UserConfig is not set. Modify $ResourceGroupName and $User in UserConfig.psm1 and try again.' } return $userConfig