#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()