Skip to content

Instantly share code, notes, and snippets.

View KidSunday's full-sized avatar

Drew KidSunday

View GitHub Profile
@duncansmart
duncansmart / Secure environment variables on windows.md
Last active August 22, 2025 13:22
Secure environment variables on windows

Encrypting

To create a DPAPI-encrypted environment variable run the following PowerShell:

[Environment]::SetEnvironmentVariable((Read-Host "Enter name"), (Read-Host "Enter value" -AsSecureString | ConvertFrom-SecureString), 'User')

And follow the prompts:

image