Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Modifying UserConfig to simplify user update and enforce lower case c…
Browse files Browse the repository at this point in the history
…onvert on user value
  • Loading branch information
billgib committed Jun 27, 2017
1 parent 44ff640 commit 94096ef
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Learning Modules/UserConfig.psm1
Original file line number Diff line number Diff line change
@@ -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 = "<resourcegroup>" # the resource group used when the WTP application was deployed. CASE SENSITIVE
Name = $("<user>".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 = "<resourcegroup>" # the resource group used when the Wingtip SaaS application was deployed. CASE SENSITIVE
$User = "<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 "<resourcegroup>" -or $userConfig.Name -eq "<user>")
{
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
Expand Down

0 comments on commit 94096ef

Please sign in to comment.