Skip to content

Instantly share code, notes, and snippets.

@AdamZWinter
Last active March 16, 2021 17:21
Show Gist options
  • Select an option

  • Save AdamZWinter/03c5b4931cac20f3dc94604fcce51f90 to your computer and use it in GitHub Desktop.

Select an option

Save AdamZWinter/03c5b4931cac20f3dc94604fcce51f90 to your computer and use it in GitHub Desktop.

Revisions

  1. AdamZWinter created this gist Mar 16, 2021.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #Prompts for the username/password, enter the username in the form of DomainName\UserName
    $Credential = get-credential -Message "Please enter the VPM credentials"

    #Converts the password to clear text to pass it through correctly as passing through a secure string does not work.
    $Password = $credential.GetNetworkCredential().password

    #Converts the $Credential to just the DomainName/UsernName.
    $Account = $credential.UserName

    echo $Password
    echo $Password.GetType()