Skip to content

Instantly share code, notes, and snippets.

@everydayintech
Created March 8, 2023 17:12
Show Gist options
  • Select an option

  • Save everydayintech/f63db705fda8d17a71eac18504bbcc85 to your computer and use it in GitHub Desktop.

Select an option

Save everydayintech/f63db705fda8d17a71eac18504bbcc85 to your computer and use it in GitHub Desktop.
$CurrentDir = if($null -eq $MyInvocation.MyCommand.Path){Get-Location | Select-Object -ExpandProperty Path} else{Split-Path -Parent -Path $MyInvocation.MyCommand.Path}
$Filename = Read-Host -Prompt "Enter Filename"
$SecretFile = (Join-Path $CurrentDir $Filename)
Read-Host -AsSecureString -Prompt "Enter Secret" | ConvertFrom-SecureString | Out-File $SecretFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment