[CmdletBinding()]param( [Parameter(ParameterSetName="OptionA")] [Parameter(ParameterSetName="Path")] [switch]$Force, [Parameter(ParameterSetName="Path",Mandatory)] [switch]$ReturnFullPath, [Parameter(ParameterSetName="Path")] [switch]$IncludeRoot ) $local:packages = [Packagesz]::_GetValidValues("", -not $Force, $true) | Sort-Object if( $IncludeRoot -and $ReturnFullPath ) { $MyPSScriptRoot } foreach ( $local:pkg in $packages ) { if( $ReturnFullPath ) { Join-Path $MyPSScriptRoot $pkg } else { $pkg } }