function Do-Something {
[CmdLetBinding(DefaultParameterSetName="Group1")]
param(
[Alias("pn", "p")]
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline=$true, ParameterSetName = "Group1")]
[type]$ParameterName = $defaultValue,
# more parameters
)
process {
if($PSCmdlet.ParameterSetName -eq 'Group1') {
# ...
}
}
}
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[ValidateLength(length)]
[ValidateCount(count)]
[ValidateRange(min, max)]
[ValidateSet("foo", "bar")]
[ValidatePattern("REGEX")]
[ValidateScript({ Test-Path $_ })]