You can specify this in the CmdletBinding argument. Even if PositionalBinding is set to $ false, you can still assign positions to your parameters. PowerShell will no longer automatically assign positions to your options, so all options are named unless otherwise specified.
function foo {
[CmdletBinding(PositionalBinding=$false)]
param (
[Parameter()]
[String]$a,
[Parameter(Position=0)]
[String]$a,
)
}
source
share