The whole point of using ValueFromPipeline (and ValueFromPipelineByPropertyName) is to replace this syntax:
"c:\windows","c:\Program Files" | ForEach-Object {
Get-DirectoryFileSize -Directory $_
}
With this synax:
The whole point of using ValueFromPipeline (and ValueFromPipelineByPropertyName) is to replace this syntax:
"c:\windows","c:\Program Files" | ForEach-Object {
Get-DirectoryFileSize -Directory $_
}
With this synax:
<# | |
.SYNOPSIS | |
Start a web server that will route requests to a series of script blocks as defined by the -Routes parameter. | |
.DESCRIPTION | |
Starts a single-threaded web server and responds to requests by executing the script blocks that are | |
defined as routes on the command line. | |
.NOTES | |
Copyright 2013 Chris Duck |
function New-Node { | |
[OutputType("Whatsupduck.Powershell.GraphViz.Node")] | |
param( | |
[Parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[String]$Name, | |
[Parameter(Mandatory=$false)] |
function Test-Function { | |
param( | |
[Parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
[ValidateNotNull()] | |
[System.Management.Automation.FunctionInfo]$Function, | |
[switch]$IgnoreWarnings, | |
[switch]$IgnoreMissingHelp | |
) |
[Reflection.Assembly]::LoadWithPartialName("System.Speech") > $null | |
function InitGrammar { | |
param( | |
$Attention, | |
$CommandArray | |
) | |
$choices = new-object System.Speech.Recognition.Choices($CommandArray) |
$CfgData =@{ | |
AllNodes =@( | |
@{ | |
NodeName = $Env:Computername; | |
PSDscAllowPlainTextPassword = $true; | |
} | |
) | |
} | |
configuration TestFile { |
function Get-HexValue { | |
param( | |
[Parameter(Mandatory=$true)] | |
[Char]$Character, | |
[ValidateSet("ASCII","BigEndianUnicode","Default","Unicode","UTF32","UTF7","UTF8")] | |
[String]$Encoding = "Unicode" | |
) | |
$E = [Text.Encoding]::$Encoding | |
$Bytes = $E.GetBytes($Character) |
function car { | |
[CmdletBinding(DefaultParameterSetName='DefaultParameter', HelpUri='http://go.microsoft.com/fwlink/?LinkID=113387', RemotingCapability='None')] | |
param( | |
[Parameter(ValueFromPipeline=$true)] | |
[psobject] | |
${InputObject}, | |
[Parameter(ParameterSetName='SkipLastParameter', Position=0)] | |
[Parameter(ParameterSetName='DefaultParameter', Position=0)] | |
[System.Object[]] |
$TempPath = [IO.Path]::GetTempPath() | |
$SBin = "C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.5.3.60710\sbin" | |
$NodeNameBase = [IO.Path]::GetFileNameWithoutExtension([IO.Path]::GetRandomFileName()) | |
$NodeName = "$NodeNameBase@$Env:COMPUTERNAME" | |
$RabbitBase = Join-Path $TempPath $NodeNameBase | |
$ErlangHome = "c:\Program Files\erl7.0" | |
$RabbitPort = 5672 | |
$MgmtPort = 15672 |
<# | |
Copyright 2015 Chris Duck | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |