Public/Add-Vector.ps1
|
function Add-Vector { <# .SYNOPSIS Adds two vectors. .DESCRIPTION Returns a new Vector that is the component-wise sum of Vector1 and Vector2. .PARAMETER Vector1 The first vector. .PARAMETER Vector2 The second vector. .EXAMPLE Add-Vector -Vector1 (New-Vector 1,2,3) -Vector2 (New-Vector 4,5,6) #> [CmdletBinding()] [OutputType('Vector')] param( [Parameter(Mandatory, Position = 0)] [Vector] $Vector1, [Parameter(Mandatory, Position = 1)] [Vector] $Vector2 ) return $Vector1.Add($Vector2) } |