Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/functions/completers.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Register-ArgumentCompleter -CommandName Uninstall-Font, Get-Font -ParameterName Name -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
$null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters
if ([string]::IsNullOrEmpty($fakeBoundParameters['Scope'])) {
Get-Font -Scope 'CurrentUser' | Where-Object { $_.Name -like "$wordToComplete*" } | Select-Object -ExpandProperty Name
} else {
Get-Font -Scope $fakeBoundParameters['Scope'] | Where-Object { $_.Name -like "$wordToComplete*" } | Select-Object -ExpandProperty Name
}
}
10 changes: 0 additions & 10 deletions src/functions/public/Uninstall-Font.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,3 @@ Please run the command again with elevated rights (Run as Administrator) or prov
Write-Verbose "[$functionName] - Done"
}
}

Register-ArgumentCompleter -CommandName Uninstall-Font -ParameterName Name -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
$null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters
if ([string]::IsNullOrEmpty($fakeBoundParameters['Scope'])) {
Get-Font -Scope 'CurrentUser' | Where-Object { $_.Name -like "$wordToComplete*" } | Select-Object -ExpandProperty Name
} else {
Get-Font -Scope $fakeBoundParameters['Scope'] | Where-Object { $_.Name -like "$wordToComplete*" } | Select-Object -ExpandProperty Name
}
}