Created
December 4, 2021 19:46
-
-
Save jordan-carson/20705e013d9c96b1621513713b858ba7 to your computer and use it in GitHub Desktop.
setting secrets in powershell - terminate once session finishes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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