Skip to content

Replace Global Variables with SessionState #2

Description

@jeffpatton1971

Instead of exposing information via $Global, we should be placing sensitive information in the sessionState.

https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.sessionstate

current

Set-Variable -Name azDevOpsHeader -Value $azDevOpsHeader -Scope Global

proposed

$PSCmdlet.SessionState.PSVariable.Set('azDevOpsHeader',$azDevOpsHeader)

There is potential to set scope on these to make them private so they are only accessible within the module.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions