Skip to content

Powershell Patterns SectionΒ #101

@JohnLBevan

Description

@JohnLBevan

Most languages have a few patterns defining template solutions to common problems, along with related terminology to aid in understanding. It would be good to create a section in here for such patterns.

Examples of common scenarios I've come across where having well defined solutions & consistent approaches across PS modules would be useful are:

  • Handling paged data (e.g. calling web services which return up to N results per call).
  • Working with connections (i.e. where you hold the connection in an object passed to various commands, then close that connection at the end, rather than simply using Begin and End blocks to contain a connection whilst data's coming through the pipeline).
  • Dependency injection. e.g. say you provide commands for collecting and persisting data, but wish to give the user different options on how that could be persisted (write to database, export to CSV, export to XML, etc).

Related, there are some patterns defined in here: https://xainey.github.io/2016/powershell-classes-and-concepts/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions