I understand that I can use both methods to save a password to a text file:
Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File C:\cred.txt
and
Get-Credential | Export-Clixml c:\cred.xml
I also understand that both methods make the password accessible only to the account that created the output file and on the machine where it was created. That said, is one method more secure than the other? Are there other benefits or risks associated with one or the other?