read-host -assecurestring | convertfrom-securestring | out-file
i have tried command on 3 different pc (2008r2 , win7)
read-host -assecurestring | convertfrom-securestring | out-file c:\posh\cred.txt
i used same user account create cred.txt , run command.
in cred.txt just simple text like “jhdfjdhjfdhfjdhjfdf”
an error got:
ps c:\posh> read-host -assecurestring | convertfrom-securestring | out-file c:\posh\cred.txt
convertfrom-securestring : cannot process argument because value of argument "securestring" invalid. change value of "securestring" argument , run operation again.
at line:1 char:53
+ read-host -assecurestring | convertfrom-securestring <<<< | out-file c:\posh\cred.txt
+ categoryinfo : invalidargument: (:) [convertfrom-securestring],
psargumentexception
+ fullyqualifiederrorid : argument,microsoft.powershell.commands.convertfr
omsecurestringcommand
is there i’m doing improper way?
did enter empty string @ read-host prompt? that's way i've been able reproduce error far; convertfrom-securestring doesn't accept empty securestrings. might add prompt read-host call, know when type something:
read-host -prompt 'enter password' -assecurestring | convertfrom-securestring | out-file c:\posh\cred.txt
Windows Server > Windows PowerShell
Comments
Post a Comment