Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created September 21, 2020 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrateekKumarSingh/39e0e6396c4be0cddd3be2224272ded9 to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/39e0e6396c4be0cddd3be2224272ded9 to your computer and use it in GitHub Desktop.
using System.Management.Automation;
namespace ReadSecurely
{
class Program
{
static void Main(string[] args)
{
// this doesn't works
PowerShell ps = PowerShell.Create();
var pass = ps.AddCommand("Read-Host").AddParameter("AsSecureString").Invoke();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment