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

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607