Module design with session based variable

Welcome Forums General PowerShell Q&A Module design with session based variable

This topic contains 3 replies, has 3 voices, and was last updated by

 
Participant
2 years, 1 month ago.

  • Author
    Posts
  • #68173

    Participant
    Topics: 9
    Replies: 16
    Points: 1
    Rank: Member

    I have a few functions which call each other recursively. Some of these functions rely on an object in the session which provides caching functionality.

    With binary cmdlets, we have SessionState.PSVariable.{Set|GetValue} etc. With a text based module, what is the best approach?

  • #68175

    Keymaster
    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    A module-level variable.

  • #68196

    Participant
    Topics: 8
    Replies: 1190
    Points: 639
    Helping Hand
    Rank: Major Contributor
  • #68211

    Participant
    Topics: 9
    Replies: 16
    Points: 1
    Rank: Member

    Thanks guys,
    So what does PrivateData (with all the limitations) actually provide over and above simple, non exported variables in the module file?

The topic ‘Module design with session based variable’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort