Tag: PowerShell function–parameters-data types-return

PowerShell: How to pass multiple parameters into a function in PowerShell

  In this post I will show how to pass multiple parameters into a function in PowerShell coding.    Addition of numbers function using PowerShell example: cls #The below sample function will accept numeric parameters and do the addtion. Function Add-Numbers() { param ( [Parameter(Mandatory=$true)] [int32] $FirstNumber, [Parameter(Mandatory=$true)] [int32] $SecondNumber, [Parameter(Mandatory=$false)][int32] $ThirdNumber ) Try {

Continue reading