X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=nerdfont%2Finstall.ps1;h=cd6aa45d97186946248f6116b97c09592e1cfb9a;hb=aa61db993471a5ec35fadbc050126735b9fc200a;hp=668c7585a3ccbdac109632e09a6d36f7f9a5437f;hpb=46445e9382905a52e770d44191235be179616049;p=webi-installers%2F.git diff --git a/nerdfont/install.ps1 b/nerdfont/install.ps1 index 668c758..cd6aa45 100644 --- a/nerdfont/install.ps1 +++ b/nerdfont/install.ps1 @@ -3,7 +3,7 @@ $my_nerdfont_otf = "Droid Sans Mono for Powerline Nerd Font Complete Windows Compatible.otf" $my_fontdir = "$Env:UserProfile\AppData\Local\Microsoft\Windows\Fonts" -New-Item -Path "$my_fontdir" -ItemType Directory -Force +New-Item -Path "$my_fontdir" -ItemType Directory -Force | out-null IF (!(Test-Path -Path "$my_fontdir\$my_nerdfont_otf")) { @@ -18,7 +18,7 @@ pushd "$my_fontdir" $regFontPath = "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" $fontRegistryPath = "HKCU:$regFontPath" $fontFiles = Get-ChildItem -Recurse -Include *.ttf, *.otf -$null = foreach($font in $fontFiles) { +foreach($font in $fontFiles) { # See https://github.com/PPOSHGROUP/PPoShTools/blob/master/PPoShTools/Public/FileSystem/Add-Font.ps1#L80 Add-Type -AssemblyName System.Drawing $objFontCollection = New-Object System.Drawing.Text.PrivateFontCollection @@ -27,9 +27,12 @@ $null = foreach($font in $fontFiles) { $regTest = Get-ItemProperty -Path $fontRegistryPath -Name "*$FontName*" -ErrorAction SilentlyContinue if (-not ($regTest)) { - New-ItemProperty -Name $FontName -Path $fontRegistryPath -PropertyType string -Value $font.FullName - Write-Output "Registering font {$($font.Name)} in registry with name {$FontName}" + New-ItemProperty -Name $FontName -Path $fontRegistryPath -PropertyType string -Value $font.Name + Write-Output "Registered font {$($font.Name)} in Current User registry as {$FontName}" } + echo "Installed $my_nerdfont_otf to $my_fontdir" + # because adding to the registry alone doesn't actually take + & start $font.FullName + echo "" + echo "IMPORTANT: Click 'Install' to complete installation" } - -echo "Installed $my_nerdfont_otf to $my_fontdir"