Skip to content

Commit fa9a34f

Browse files
committed
Update tag metadata to include the PSEditions and platforms supported by the script
1 parent aa59426 commit fa9a34f

File tree

1 file changed

+78
-6
lines changed

1 file changed

+78
-6
lines changed

src/powershell-extended/Invoke-NerdFontInstaller.ps1

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<#PSScriptInfo
44
5-
.VERSION 1.1.0
5+
.VERSION 1.1.1
66
77
.GUID a3238c59-8a0e-4c11-a334-f071772d1255
88
99
.AUTHOR Julian Pawlowski
1010
1111
.COPYRIGHT © 2024 Julian Pawlowski.
1212
13-
.TAGS nerd-fonts nerdfonts cascadia-code cascadia-code-nerd-font cascadia-code-powerline-font cascadia-mono cascadia-mono-nerd-font cascadia-mono-powerline-font
13+
.TAGS fonts nerdfonts cascadia-code cascadia-code-nerd-font cascadia-code-powerline-font cascadia-mono cascadia-mono-nerd-font cascadia-mono-powerline-font powershell powershell-script Windows MacOS Linux PSEdition_Core PSEdition_Desktop
1414
1515
.LICENSEURI https://github.com/jpawlowski/devcontainer-features/blob/main/LICENSE.txt
1616
@@ -25,9 +25,8 @@
2525
.EXTERNALSCRIPTDEPENDENCIES
2626
2727
.RELEASENOTES
28-
Version 1.1.0 (2024-08-29)
29-
- Add support for multiple types of font archives
30-
- Add XDG compliance for determining the target folder for fonts
28+
Version 1.1.1 (2024-08-31)
29+
- Update tag metadata to include the PSEditions and platforms supported by the script
3130
#>
3231

3332
<#
@@ -192,7 +191,16 @@ param(
192191
[ValidateSet('AllUsers', 'CurrentUser')]
193192
[string]$Scope = 'CurrentUser',
194193

195-
[switch]$Force
194+
[Parameter(Mandatory = $false, ParameterSetName = 'ByAll')]
195+
[Parameter(Mandatory = $false, ParameterSetName = 'ByName')]
196+
[switch]$Force,
197+
198+
# Hidde commands to help when used as a script block only
199+
[Parameter(Mandatory = $true, ParameterSetName = 'Help')]
200+
[switch]$Help,
201+
202+
[Parameter(Mandatory = $true, ParameterSetName = 'Version')]
203+
[switch]$Version
196204
)
197205

198206
dynamicparam {
@@ -439,6 +447,70 @@ param(`$commandName, `$parameterName, `$wordToComplete, `$commandAst, `$fakeBoun
439447
}
440448

441449
begin {
450+
if ($Help) {
451+
$scriptContent = $MyInvocation.MyCommand.ScriptBlock.ToString()
452+
$helpContent = @()
453+
$inHelpBlock = $false
454+
$helpBlockFound = $false
455+
456+
foreach ($line in $scriptContent -split "`n") {
457+
if ($line -match '^\s*<#' -and -not $helpBlockFound) {
458+
if ($line -notmatch '^\s*<#PSScriptInfo') {
459+
$inHelpBlock = $true
460+
}
461+
}
462+
if ($inHelpBlock) {
463+
$helpContent += $line
464+
}
465+
if ($line -match '#>\s*$' -and $inHelpBlock) {
466+
$inHelpBlock = $false
467+
$helpBlockFound = $true
468+
}
469+
if ($helpBlockFound -and -not $inHelpBlock) {
470+
break
471+
}
472+
}
473+
474+
if ($helpContent) {
475+
$helpText = $helpContent -join "`n"
476+
Write-Output $helpText
477+
} else {
478+
Write-Output "No help content found."
479+
}
480+
return
481+
}
482+
483+
if ($Version) {
484+
$scriptContent = $MyInvocation.MyCommand.ScriptBlock.ToString()
485+
$helpContent = @()
486+
$inHelpBlock = $false
487+
$helpBlockFound = $false
488+
489+
foreach ($line in $scriptContent -split "`n") {
490+
if ($line -match '^\s*<#PSScriptInfo' -and -not $helpBlockFound) {
491+
$inHelpBlock = $true
492+
}
493+
if ($inHelpBlock) {
494+
$helpContent += $line
495+
}
496+
if ($line -match '#>\s*$' -and $inHelpBlock) {
497+
$inHelpBlock = $false
498+
$helpBlockFound = $true
499+
}
500+
if ($helpBlockFound -and -not $inHelpBlock) {
501+
break
502+
}
503+
}
504+
505+
if ($helpContent) {
506+
$helpText = $helpContent -join "`n"
507+
Write-Output $helpText
508+
} else {
509+
Write-Output "No help content found."
510+
}
511+
return
512+
}
513+
442514
if ($PSBoundParameters.ContainsKey('List')) {
443515
# Set default value if List is null or empty
444516
if ([string]::IsNullOrEmpty($List)) {

0 commit comments

Comments
 (0)