Join in the Pipeline

Quick and dirty join function for powershell, that utilizes the pipeline.

function join 
{
	param($delimiter)
 
	begin { $strings = @() }
	process { $strings += $_ }
	end { [string]::Join($delimiter, $strings) }
}

The following now works:

> "Hello", "World" | join " "
Hello World

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

Tags:

Leave a Reply