Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was 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

@elmalakai

Description

@elmalakai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions