How to mask the password while passing password through parameter RRS feed

  • Question

  • Hi

    Please help me to mask the password while it is passed through a parameter in powershell .

    Thanks and Regards


    Monday, January 7, 2019 11:29 AM

All replies

  • use get-credentials Cmdlet for the password enter or another way is to use Read-host with assecurestring switch.
    $password = Read-Host "Enter Password" -AsSecureString

    • Proposed as answer by jrv Monday, January 7, 2019 12:34 PM
    Monday, January 7, 2019 11:58 AM
  • Thanks for the answer.

    Is there any other way to mask the password while using inside param

    Monday, January 7, 2019 1:21 PM
  • another way is to encrypt an save the password in a text file.

    When required just decrypt and use it.

    Monday, January 7, 2019 1:35 PM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Just do it.

    Tuesday, January 22, 2019 7:51 AM