Skip to content

Instantly share code, notes, and snippets.

@chriskuech
Created June 11, 2019 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriskuech/e03d85ed02b479c7ec7aa591485312a7 to your computer and use it in GitHub Desktop.
Save chriskuech/e03d85ed02b479c7ec7aa591485312a7 to your computer and use it in GitHub Desktop.
enum MyAutocompleteValues {
A,
B,
C
}
# initialize values once instead of on every invokation
$someDynamicSetting = ...
function myHelperFunction($a, $b) {
...
}
# this function would otherwise be defined on every call,
# if it was implemented as a script
function Get-BadNode {
Param(
# tab completion with MyAutocompleteValues
[MyAutocompleteValues]$Value
)
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment