提示憑據
要提示輸入憑據,你幾乎應該始終使用 Get-Credential
cmdlet:
$credential = Get-Credential
預填充的使用者名稱:
$credential = Get-Credential -UserName 'myUser'
新增自定義提示訊息:
$credential = Get-Credential -Message 'Please enter your company email address and password.'
要提示輸入憑據,你幾乎應該始終使用 Get-Credential
cmdlet:
$credential = Get-Credential
預填充的使用者名稱:
$credential = Get-Credential -UserName 'myUser'
新增自定義提示訊息:
$credential = Get-Credential -Message 'Please enter your company email address and password.'