PowerShell_Scripts/base/Get-MyPackages.ps1

22 lines
564 B
PowerShell
Raw Normal View History

[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
}
}