Search notes:

Powershell: Param(Parameter(ValueFromPipeline=…)

A parameter that has its valueFromPipeline attribute set to $true gets its values from the pipeline (if the command is executed within a pipeline).
A function that has such a valueFromPipeline parameter needs to have a process block to process the individual objects from the pipeline.
set-strictMode -version 3

function show-piped-objects {

   param (
      [parameter (valueFromPipeline=$true )] [string] $parameterFromPipeline,
                                             [string] $ordinaryParameter
   )


   process {
      write-host "ordinaryParameter: $ordinaryParameter, parameterFromPipeline = $parameterFromPipeline"
   }

}

'foo', 'bar', 'baz' | show-piped-objects -ordinaryParameter XXX
Github repository about-PowerShell, path: /language/statement/function/parameters/attributes/parameter/valueFromPipeline/show-piped-objects.ps1

TODO

This stackoverflow answer indicates that parameters with valueFromPipeline=$true should not also have a position attribute.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758193828, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/language/statement/function/parameters/attributes/parameter/valueFromPipeline/index(60): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78