Script directory for a PowerShell profile. https://blog.lksz.me/keeping-track-of-everything/#-mypsscriptroot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
413 B

  1. [CmdletBinding()]param(
  2. [string]$WordToComplete,
  3. [string[]]$FullValueSet,
  4. [switch]$Strict
  5. )
  6. $local:possibleValues = $fullValueSet
  7. if( $wordToComplete ) {
  8. $possibleValues = $possibleValues | Where-Object { $_ -match $wordToComplete }
  9. if( -not $strict -and ($wordToComplete -notin $possibleValues) ) {
  10. $possibleValues = $( $wordToComplete; $possibleValues )
  11. }
  12. }
  13. return $possibleValues