forked from lzybkr/TabExpansionPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetTCPIP.ps1
26 lines (21 loc) · 978 Bytes
/
NetTCPIP.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## NetTCPIP module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -InterfaceAlias,ifAlias arguments to NetTCPIP module cmdlets
#
function NetIPAddressInterfaceAliasParameterCompleter
{
[ArgumentCompleter(
Parameter = 'InterfaceAlias',
Command = { Get-CommandWithParameter -Module NetTCPIP -ParameterName InterfaceAlias},
Description = 'Complete InterfaceAlias names, for example: Get-NetIPAddress -InterfaceAlias <TAB>')]
[ArgumentCompleter(
Parameter = 'ifAlias',
Command = { Get-CommandWithParameter -Module NetTCPIP -ParameterName ifAlias},
Description = 'Complete ifAlias names, for example: Get-NetIPAddress -ifAlias <TAB>')]
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
NetTCPIP\Get-NetIPAddress -InterfaceAlias "$wordToComplete*" | Sort-Object InterfaceAlias | ForEach-Object {
New-CompletionResult $_.InterfaceAlias $_.InterfaceAlias
}
}