How do I pass parameters to PowerShell scripts?
function Test-Script {
param($Name,$Age)
"$Name is roughly $Age years old"
}
Test-Script "The Doctor" "4.5 billion"
Test-Script -Name Mother -Age 29PreviousHow do I determine the current version of PowerShell?NextHow do I fix "the execution of scripts is disabled on this system" errors?
Last updated
Was this helpful?