https://github.com/turbobasic/powershell-mvc-pipeline-cmdlet
Template of Windows Powershell Cmdlet based on MVC pattern. Allow to look into the details of what's going on inside Powershell command pipeline
https://github.com/turbobasic/powershell-mvc-pipeline-cmdlet
Last synced: over 1 year ago
JSON representation
Template of Windows Powershell Cmdlet based on MVC pattern. Allow to look into the details of what's going on inside Powershell command pipeline
- Host: GitHub
- URL: https://github.com/turbobasic/powershell-mvc-pipeline-cmdlet
- Owner: turboBasic
- License: mit
- Created: 2017-06-16T23:56:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-17T00:36:01.000Z (about 9 years ago)
- Last Synced: 2025-01-22T16:45:49.338Z (over 1 year ago)
- Language: PowerShell
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Powershell-MVC-Pipeline-Cmdlet
Template of Windows Powershell Cmdlet based on MVC pattern. Allow to look into the details of what's going on inside Powershell command pipeline

````
.SYNOPSIS
Processes pipeline or direct input and prints objects inside the Pipeline
.DESCRIPTION
Processes pipeline or direct input and provide detailed messages about internal state of Powershell command pipeline
.PARAMETER ComputerName
Demo parameter. Accepts both multiple items both directly and from pipeline
.NOTES
Name: Test-Pipeline
Author: Andriy Melnyk
Created: 16 Jun 2017
Based on excellent code of @RamblingCookieMonster from https://ramblingcookiemonster.wordpress.com/2014/12/29/powershell-pipeline-demo/
.EXAMPLE
PS> Test-Pipeline "Item1" PC2 Server3
BEGIN Block -
$ComputerName is a System.String[] with value Item1,PC2,Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1, PC2, Server3}
PROCESS Block -
$ComputerName is a System.String[] with value Item1,PC2,Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1, PC2, Server3}
PROCESS Block, FOREACH LOOP -
processed item is a System.String with value Item1
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1, PC2, Server3}
PROCESS Block, FOREACH LOOP -
processed item is a System.String with value PC2
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1, PC2, Server3}
PROCESS Block, FOREACH LOOP -
processed item is a System.String with value Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1, PC2, Server3}
END Block -
$ComputerName is a System.String[] with value Item1,PC2,Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1, PC2, Server3}
Description
-----------
Iterates through directly entered items and prints internal state of pipeline at various stages of lifecycle
.EXAMPLE
PS> "Item1", "PC2", "Server3" | p
BEGIN Block -
$ComputerName is a System.String[] with value BBRO
$PSBoundParameters is
PROCESS Block -
$ComputerName is a System.String[] with value Item1
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1}
PROCESS Block, FOREACH LOOP -
processed item is a System.String with value Item1
$PSBoundParameters is
Key Value
--- -----
ComputerName {Item1}
PROCESS Block -
$ComputerName is a System.String[] with value PC2
$PSBoundParameters is
Key Value
--- -----
ComputerName {PC2}
PROCESS Block, FOREACH LOOP -
processed item is a System.String with value PC2
$PSBoundParameters is
Key Value
--- -----
ComputerName {PC2}
PROCESS Block -
$ComputerName is a System.String[] with value Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Server3}
PROCESS Block, FOREACH LOOP -
processed item is a System.String with value Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Server3}
END Block -
$ComputerName is a System.String[] with value Server3
$PSBoundParameters is
Key Value
--- -----
ComputerName {Server3}
Description
-----------
Iterates through arguments supplied from pipeline and prints internal state of pipeline at various stages of lifecycle
````