Skip to content

Instantly share code, notes, and snippets.

@jordan-carson
Created December 4, 2021 19:46
Show Gist options
  • Save jordan-carson/20705e013d9c96b1621513713b858ba7 to your computer and use it in GitHub Desktop.
Save jordan-carson/20705e013d9c96b1621513713b858ba7 to your computer and use it in GitHub Desktop.
setting secrets in powershell - terminate once session finishes
@echo OFF
set POWERSHELL_SCRIPT=^
$securePwd = Read-Host "Enter passphrase" -AsSecureString; ^
$plainPwd =[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePwd));^
Write-Host $plainPwd
for /f %%a in ('powershell -Command "&{%POWERSHELL_SCRIPT%}"') do (
set "USER_SECRET=%%~a"
set "ARTIFACTS_SECRET=%%~a"
)
set "ARTIFACTS_USER=JORDAN-CARSON"
set POWERSHELL_SCRIPT=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment