Module design with session based variable

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Ritmo2k Ritmo2k 2 weeks, 3 days ago.

  • Author
    Posts
  • #68173
    Profile photo of Ritmo2k
    Ritmo2k
    Participant

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    A module-level variable.

  • #68196
    Profile photo of Rob Simmers
    Rob Simmers
    Participant
  • #68211
    Profile photo of Ritmo2k
    Ritmo2k
    Participant

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

You must be logged in to reply to this topic.