Repository: PowerShell/PowerShell
File: src/Microsoft.PowerShell.Security/security/CredentialCommands.cs (C#)

Code before:
        /// <summary>
        /// Gets and sets the title on the window prompt.
        /// </summary>
        [Parameter(Mandatory = false, ParameterSetName = messageSet)]
        [ValidateNotNullOrEmpty]
        public string Title
        {
            get { return _title; }

            set { _title = value; }
        }

        private string _title = UtilsStrings.PromptForCredential_DefaultCaption;

        /// <summary>
        /// Initializes a new instance of the GetCredentialCommand
        /// class.
        /// </summary>
        public GetCredentialCommand() : base()
        {
        }

        /// <summary>
        /// The command outputs the stored PSCredential.
        /// </summary>
        protected override void BeginProcessing()
        {
            if (Credential != null)
            {
                WriteObject(Credential);
                return;
            }

            try
            {
                Credential = this.Host.UI.PromptForCredential(_title, _message, _userName, string.Empty);
            }
            catch (ArgumentException exception)
            {
                ErrorRecord errorRecord = new ErrorRecord(exception, "CouldNotPromptForCredential", ErrorCategory.InvalidOperation, null);
                WriteError(errorRecord);
            }

            if (Credential != null)
            {
                WriteObject(Credential);
            }
        }
    }
}


Review comment (suggestion):
Please use auto-implemented property:
```suggestion
        public SwitchParameter ReEnterPassword { get; set; }
```

Code after:
        /// <summary>
        /// Gets and sets the title on the window prompt.
        /// </summary>
        [Parameter(Mandatory = false, ParameterSetName = messageSet)]
        [ValidateNotNullOrEmpty]
        public string Title
        {
            get { return _title; }

            set { _title = value; }
        }

        private string _title = UtilsStrings.PromptForCredential_DefaultCaption;

        /// <summary>
        /// Gets or sets the confirm password prompt.
        /// </summary>
        [Parameter(ParameterSetName = messageSet)]
        public SwitchParameter ConfirmPassword { get; set; }

        /// <summary>
        /// Initializes a new instance of the GetCredentialCommand
        /// class.
        /// </summary>
        public GetCredentialCommand() : base()
        {
        }

        /// <summary>
        /// The command outputs the stored PSCredential.
        /// </summary>
        protected override void BeginProcessing()
        {
            if (Credential != null)
            {
                WriteObject(Credential);
                return;
            }

            try
            {
                Credential = this.Host.UI.PromptForCredential(
                    _title,
                    _message,
                    _userName,
                    ConfirmPassword,
                    string.Empty,
                    PSCredentialTypes.Default,
                    PSCredentialUIOptions.Default);
            }
            catch (ArgumentException exception)