PowerShell_Scripts/base/Get-PossibleArguments.ps1
lksz 8a93a0f123 git related improvements and implementations
+ Get-GitRepo - Clone or update a repo, with tag support
+ Get-GitHubReleaseTag - Grab tag from latest release page
+ Refresh-GitRepo - Stage all possible changes, discarding any
previously stageds changes
= GitHub repo is now git repo - as some code isn't GitHub specific
+ cat Alias for Get-Content
= Get-PossiblArguments improvement
= Invoke-WebDownload fix
= dcedit fixing bad argument processing
2021-04-04 14:42:29 -04:00

21 lines
569 B
PowerShell

[CmdletBinding()]param(
[string]$WordToComplete,
[string[]]$FullValueSet,
[switch]$Strict
)
$local:possibleValues = $fullValueSet
if( $wordToComplete ) {
$possibleValues = $possibleValues |
Where-Object { $_ -match $wordToComplete } |
ForEach-Object {
if( $_ -match ' ' ) {
"'$_'"
} else {
$_
}
}
if( -not $strict -and ($wordToComplete -notin $possibleValues) ) {
$possibleValues = $( $wordToComplete; $possibleValues )
}
}
return $possibleValues