Skip to content

Instantly share code, notes, and snippets.

View chadcatlett's full-sized avatar

Chad Catlett chadcatlett

  • Somewhere in Texas
View GitHub Profile
@kizzx2
kizzx2 / with-env.ps1
Last active December 3, 2023 23:06
Run command with environment variables in PowerShell
$ori = @{}
Try {
$i = 0
# Loading .env files
if(Test-Path $args[0]) {
foreach($line in (Get-Content $args[0])) {
if($line -Match '^\s*$' -Or $line -Match '^#') {
continue
}