Config/vscode-snippets.json
{ "functionJaap": { "prefix": "function", "body": [ "function Verb-Noun {", "\t[CmdletBinding()]", "\tparam (", "\t\t[Parameter(Mandatory)] [ValidateSet(\"Appels\", \"Peren\")] [string] $$ParameterName,", " [Parameter(Mandatory = $$true)]\r", " [ArgumentCompleter( {\r", " param ( $$commandName, $$parameterName, $$wordToComplete, $$commandAst, $$fakeBoundParameters )\r", " Get-ChildItem \"$($Path)\\$wordToComplete*\" -Directory -Name | ForEach-Object { \"`\"$$_`\"\" } }\r", " )]\r", " [ValidateScript( {\r", " $$_ -in (Get-ChildItem \"$($Path)\" -Directory -Name)\r", " } ) ]\r", " [string] $$WindowsVersion\r", "\t)\r\r", "}\r" ], "description": "Create function" } } |