PSEC - Powershell Enhanced Capability
Version 1.2.1

PSEC - Design Notes

These points are presented here in no particular sequence.

1. Class Design

PSEC internally uses the class facility of .NET extensively. Classes typically set up circular relationships in that a parent will often point to a subclass of itself.

The Powershell implementation balks at loading classes with circular references. PSEC, therefore, uses outer classes that the parent references and then the subclass is defined in lower level modules. The Task and TaskExec definitions are examples of such a design implementation. This design exploits the fact that class matching is performed at runtime, not compile time, by Powershell.

2. Validate, Validate, Validate

Many runtime errors are hard to locate. It can, for example, be a variable that unexpectedly has no value. Whenever possible code is inserted that validates implied assertions and makes a definitive exception throw if the assertion fails.

3.The use of helpers

Helper functions are supplied with PSEC that assist in extending it. The helper functions exists and notExists are examples of what is provided. The Helps tab in the  2  PSEC Document Navigation Panel provides a complete list.

4. Use of Markdown

Markdown text (suitable notated) is used before functions, classes and methods. They provide input to this document package.

The markdown is transformed into a merged stream and processed using the Pandoc Utility. The merging process gives opportunity for some customization to be implemented. The @@ prefix is used to provide PSEC specific customization and is detailed in PSEC - Markdown Usage.

PSEC - Powershell Enhanced Capability

Copyright © 2018-2021, 2022, Rexcel System Inc.