Skip to content

Using Set-PsEnv Programmatically #14

@khill-fbmc

Description

@khill-fbmc

I ran into the issue when using this in a script.

On first run of the script, the .env is read and $env is populated. Upon re-run, it fails to load because it thinks we already have (same dir)

Set-PsEnv/Set-PsEnv.psm1

Lines 35 to 40 in 1be3a96

if($Global:PreviousDir -eq (Get-Location).Path){
Write-Verbose "Set-PsEnv:Skipping same dir"
return
} else {
$Global:PreviousDir = (Get-Location).Path
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions