You should start by downloading and reviewing this document.
https://www.sapien.com/books_training/Windows-PowerShell-4
Powershell can use positional parameters or named parameters.
function TestPosition ($ProcessName,$SomethingElse) {
Write-Host ""
Write-Host "You asked me to look for $ProcessName."
Write-Host "And do something with $SomethingElse."
Get-Process $ProcessName
}
function TestNamed {param (
[string]$ProcessName = "",
[string]$SomethingElse = ""
)
Write-Host ""
Write-Host "You asked me to look for $ProcessName."
Write-Host "And do something with $SomethingElse."
Get-Process $ProcessName
}
TestPosition "notepad" "foo"
TestNamed -SomethingElse "XXXXXX" -ProcessName "Powershell"