Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 28
    You can also do ConvertTo-SecureString "password" -AsPlainText -Force. Commented Nov 26, 2013 at 3:33
  • 21
    Just to make it clear, $password = ConvertTo-SecureString "password" -AsPlainText -Force Commented Nov 29, 2013 at 13:36
  • -Credential [username] was required in Read-Host parameters for me, otherwise powershell just hangs. After passing -Credential to read-host you will be prompted directly in powershell console and password is stored correctly. Thank You! Commented Mar 1, 2017 at 8:23
  • I am trying to figure out how to get this to work when I use the Send-MailMessage function in powershell. I am wanting to store the credentials of my email user and pass so I do not have to keep entering it in. Any idea how to do this? Commented May 24, 2017 at 18:27
  • 1
    @user3681591 - I'd recommend asking a new question rather than doing this in the comments. Thanks. Commented May 24, 2017 at 19:24