Mending Broken Windows #2

Editor, no Remove-Alias before PowrShell Core.
IValidateSetValuesGenerator missing before PowerShell Core
This commit is contained in:
lksz 2020-09-30 00:14:51 -04:00
parent 586f187346
commit 607fff132f
4 changed files with 21 additions and 6 deletions

View file

@ -1,4 +1,4 @@
class FunctionName: System.Management.Automation.IValidateSetValuesGenerator {
class FunctionName { #: System.Management.Automation.IValidateSetValuesGenerator {
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$Strict) {
$local:possibleValues = Get-Command -Type Function | Select-Object -ExpandProperty Name
return $(Get-PossibleArguments -WordToComplete $wordToComplete -FullValueSet $possibleValues -Strict:$Strict );

View file

@ -1,4 +1,4 @@
class MyScript : System.Management.Automation.IValidateSetValuesGenerator {
class MyScript { #: System.Management.Automation.IValidateSetValuesGenerator {
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$Strict) {
$local:possibleValues = $(
Get-ChildItem $global:MyPSScriptRoot -Filter '*.ps1' -Recurse |