forked from lzybkr/TabExpansionPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWdac.ps1
61 lines (52 loc) · 1.95 KB
/
Wdac.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
## Wdac module Custom Completers ##
#
# .SYNOPSIS
#
# Complete the -Name arguments to *-OdbcDriver cmdlets
#
function Wdac_OdbcDriverNameParameterCompletion
{
[ArgumentCompleter(
Parameter = 'Name',
Command = {Get-CommandWithParameter -Module Wdac -Noun OdbcDriver -ParameterName Name},
Description = 'Complete the -Name arguments to *-OdbcDriver cmdlets. For example: Get-OdbcDriver -Name <TAB>'
)]
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Wdac\Get-OdbcDriver -Name "$wordToComplete*" | Sort-Object Name | ForEach-Object {
New-CompletionResult $_.Name "Name: $($_.Name)"
}
}
#
# .SYNOPSIS
#
# Complete the -Name arguments to *-OdbcDsn cmdlets
#
function Wdac_OdbcDsnNameParameterCompletion
{
[ArgumentCompleter(
Parameter = 'Name',
Command = {Get-CommandWithParameter -Module Wdac -Noun OdbcDsn -ParameterName Name},
Description = 'Complete the -Name arguments to *-OdbcDsn cmdlets. For example: Get-OdbcDsn -Name <TAB>'
)]
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Wdac\Get-OdbcDsn -Name "$wordToComplete*" | Sort-Object Name | ForEach-Object {
New-CompletionResult $_.Name "Name: $($_.Name)"
}
}
#
# .SYNOPSIS
#
# Complete the -DriverName arguments to *-OdbcDsn cmdlets
#
function Wdac_DriverNameParameterCompletion
{
[ArgumentCompleter(
Parameter = 'DriverName',
Command = {Get-CommandWithParameter -Module Wdac -Noun OdbcDsn -ParameterName DriverName},
Description = 'Complete the -DriverName arguments to *-OdbcDsn cmdlets. For example: Get-OdbcDsn -DriverName <TAB>'
)]
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Wdac\Get-OdbcDsn -DriverName "$wordToComplete*" | Sort-Object DriverName | ForEach-Object {
New-CompletionResult $_.DriverName "DriverName: $($_.DriverName)"
}
}