Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

$env:USERNAME can have invalid characters in it for a URI #11

Open
elmalakai opened this issue Dec 7, 2017 · 0 comments
Open

$env:USERNAME can have invalid characters in it for a URI #11

elmalakai opened this issue Dec 7, 2017 · 0 comments

Comments

@elmalakai
Copy link

Using the Username to generate the URI for the AD Application can result in an error. I had to do some basic cleaning on it:

$userName = $env:USERNAME
$userName = $userName -replace "[' ]"

I'm sure there is a better way to clean the string for the URI. In the end I added a new param to ask for the App Name.

Also the SecureString issue mentioned above. I didn't change the Input, but added this:

$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$azureAdApplication = New-AzureRmADApplication -DisplayName $displayName -HomePage $homePage -IdentifierUris $identifierUri -Password $securePassword -Verbose

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant