Convertfrom-securestring : "SecureString" is not valid


Convertfrom-securestring : Cannot process argument because the value of argument "SecureString" is not valid


Summary

This TechNet Wiki is based on TechNet Forum Post - read-host -assecurestring | convertfrom-securestring | out-file

Background

This is not a technical issue or a glitch just a human error. However interesting fact and fun! OP executed the below code:

001
Read-host -AsSecureString | ConvertFrom-SecureString | Out-File C:\posh\cred.txt

Error

Solution/Fix

David Wyatt identified the cause of issue - OP passed empty string as password and that caused the above error.
To reproduce this execute the code and push enter in the Read-Host prompt!