Description
Use -InputObject instead of pipe operator
Most of the powerGate cmdlets pipe their input object into the cmdlet. This results in very poor readability as it looks like an assignment on the first sight. Using the -InputObject parameter would increase readability.
For example:

could be

An exception can be made if there is an assignment prior to the pipe as in this case there is no risk of confusion

Use $null = instead of | Out-Null
In multiple places unused output is piped into | Out-Null. This is hard to read as the scripting guy has to look to the right to see that the output is handled, when usually they would look to the left to see an assignment.

Instead $null = should be used as this is more consistent and easier to read

Don't use positional parameters
Also cmdlet calls use the -InputObject parameter, but as a positional parameter. This also causes worse readability. Named parameters are preferred as they make it obvious on sight what parameters are used. They also make it easier to debug errors when invalid values like $null are passed.

should be

Consistently name variables
Some variables are not named in a way that reflects their content. In the following example the variable is named erpBomHeaderResult, but it actually contains an Erp-BOM header.

should be

Some variables are named, but actually never used. In this case the return value of the function should be assigned to $null. This makes it immediately clear that the value never is used.

should be

Tasks:
Description
Use
-InputObjectinstead of pipe operatorMost of the powerGate cmdlets pipe their input object into the cmdlet. This results in very poor readability as it looks like an assignment on the first sight. Using the -InputObject parameter would increase readability.


For example:
could be
An exception can be made if there is an assignment prior to the pipe as in this case there is no risk of confusion

Use
$null =instead of| Out-NullIn multiple places unused output is piped into

| Out-Null. This is hard to read as the scripting guy has to look to the right to see that the output is handled, when usually they would look to the left to see an assignment.Instead

$null =should be used as this is more consistent and easier to readDon't use positional parameters
Also cmdlet calls use the


-InputObjectparameter, but as a positional parameter. This also causes worse readability. Named parameters are preferred as they make it obvious on sight what parameters are used. They also make it easier to debug errors when invalid values like $null are passed.should be
Consistently name variables
Some variables are not named in a way that reflects their content. In the following example the variable is named erpBomHeaderResult, but it actually contains an Erp-BOM header.


should be
Some variables are named, but actually never used. In this case the return value of the function should be assigned to $null. This makes it immediately clear that the value never is used.


should be
Tasks:
-InputObjectinstead of pipe operator$null =instead of| Out-Null