logo
  • 教程列表
  • SO官方文档
  • 处理秘密和证书
    • 访问明文密码
    • 提示凭据
    • 使用存储的凭据
    • 以加密形式存储凭据并在需要时将其作为参数传递
  1. StackOverflow 文档
  2. PowerShell 教程
  3. 处理秘密和证书
  4. 提示凭据

提示凭据

Created: November-22, 2018

要提示输入凭据,你几乎应该始终使用 Get-Credential cmdlet:

$credential = Get-Credential

预填充的用户名:

$credential = Get-Credential -UserName 'myUser'

添加自定义提示消息:

$credential = Get-Credential -Message 'Please enter your company email address and password.'
  • 使用存储的凭据
  • 访问明文密码

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明