From e4d7575c6ddb0e19be78626c73c9f5e51d50884f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 13 Feb 2025 13:38:25 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20argument?= =?UTF-8?q?=20completer=20to=20support=20multiple=20commands=20in=20Uninst?= =?UTF-8?q?all-Font?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions/public/Uninstall-Font.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/public/Uninstall-Font.ps1 b/src/functions/public/Uninstall-Font.ps1 index aac6276..e646c60 100644 --- a/src/functions/public/Uninstall-Font.ps1 +++ b/src/functions/public/Uninstall-Font.ps1 @@ -134,7 +134,7 @@ Please run the command again with elevated rights (Run as Administrator) or prov } } -Register-ArgumentCompleter -CommandName Uninstall-Font -ParameterName Name -ScriptBlock { +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'])) { From 7e5b381ced6ae17a7b2ef84ddf6125f1d090d6cf Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 13 Feb 2025 13:42:06 +0100 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Move=20argument?= =?UTF-8?q?=20completer=20for=20Uninstall-Font=20and=20Get-Font=20to=20a?= =?UTF-8?q?=20separate=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions/completers.ps1 | 9 +++++++++ src/functions/public/Uninstall-Font.ps1 | 10 ---------- 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 src/functions/completers.ps1 diff --git a/src/functions/completers.ps1 b/src/functions/completers.ps1 new file mode 100644 index 0000000..c1709a2 --- /dev/null +++ b/src/functions/completers.ps1 @@ -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 + } +} diff --git a/src/functions/public/Uninstall-Font.ps1 b/src/functions/public/Uninstall-Font.ps1 index e646c60..5e36b04 100644 --- a/src/functions/public/Uninstall-Font.ps1 +++ b/src/functions/public/Uninstall-Font.ps1 @@ -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, 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 - } -} From ba6d5107e39e4ee63d28fa4078f72db88cf4dc56 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 14 Feb 2025 08:04:36 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20Get-Font?= =?UTF-8?q?=20synopsis=20to=20include=20additional=20details=20about=20out?= =?UTF-8?q?put?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions/public/Get-Font.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/public/Get-Font.ps1 b/src/functions/public/Get-Font.ps1 index 4b2eb40..59c4eff 100644 --- a/src/functions/public/Get-Font.ps1 +++ b/src/functions/public/Get-Font.ps1 @@ -3,7 +3,7 @@ function Get-Font { <# .SYNOPSIS - Retrieves the installed fonts. + Retrieves the installed fonts. Uri, Api, file name. .DESCRIPTION Retrieves the installed fonts. From 3b5cc817cdbed7f916ef3f092e25b733c852fca5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 14 Feb 2025 08:08:55 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20workflow?= =?UTF-8?q?=20reference=20to=20use=20the=20fixDocs=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Process-PSModule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml index da48a8b..aa21e39 100644 --- a/.github/workflows/Process-PSModule.yml +++ b/.github/workflows/Process-PSModule.yml @@ -26,5 +26,5 @@ permissions: jobs: Process-PSModule: - uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v3 + uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@fixDocs secrets: inherit From 469b122a3776eeac8fab0e90aa9020624a436a01 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 14 Feb 2025 08:17:24 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Simplify=20Get-Fo?= =?UTF-8?q?nt=20synopsis=20by=20removing=20redundant=20details?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions/public/Get-Font.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/public/Get-Font.ps1 b/src/functions/public/Get-Font.ps1 index 59c4eff..4b2eb40 100644 --- a/src/functions/public/Get-Font.ps1 +++ b/src/functions/public/Get-Font.ps1 @@ -3,7 +3,7 @@ function Get-Font { <# .SYNOPSIS - Retrieves the installed fonts. Uri, Api, file name. + Retrieves the installed fonts. .DESCRIPTION Retrieves the installed fonts. From 8612530f04a5e0882ed79ce4bb1ff9b166903091 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 14 Feb 2025 08:33:13 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20workflow?= =?UTF-8?q?=20reference=20to=20use=20version=20v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Process-PSModule.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml index aa21e39..da48a8b 100644 --- a/.github/workflows/Process-PSModule.yml +++ b/.github/workflows/Process-PSModule.yml @@ -26,5 +26,5 @@ permissions: jobs: Process-PSModule: - uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@fixDocs + uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v3 secrets: inherit