DEV Community

NoNSDevops
NoNSDevops

Posted on

Create a Powershell Credential

  1. Interactive, Windows prompt
 $Credential = Get-Credential
  2. In 1 command
$Credential = [pscredential]::new('admin',(ConvertTo-SecureString 'StrongPass123!' -AsPlainText -Force))



Or

$Credential = [pscredential]::new('admin',(ConvertTo-SecureString $env:Github_Password -AsPlainText -Force))


Discussion (0)