Created
November 6, 2020 14:21
-
-
Save virtualhobbit/13d91570b49011aa1dec9de52d36c013 to your computer and use it in GitHub Desktop.
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
retrieve_vault_password: | |
stage: retrieve | |
tags: | |
- windows | |
artifacts: | |
paths: | |
- windows-10/setup/Autounattend.xml | |
script: | |
- Write-Host "Retrieving Administrator password from Vault" | |
- $result = Invoke-RestMethod -Headers @{"X-Vault-Token" = ${env:VAULT_TOKEN}} -Method Get -Body $json -Uri ${env:VAULT_ADDR}/v1/creds/users/misc/administrator | |
- $pass = $result.data.Password | |
- Write-Host "Updating Autounattend.xml file with Administrator password" | |
- (Get-Content $xmlFile -Raw) -replace '{{password}}',$pass | Set-Content $xmlFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment