diff --git a/requirements.ps1 b/requirements.ps1 index 6c66119..d667403 100644 --- a/requirements.ps1 +++ b/requirements.ps1 @@ -220,19 +220,22 @@ if ($Flags.FontsEnabled) Write-Divider Write-Host "Installing Fonts" Set-Location ~ - Remove-Item ~\fonts | Out-Null wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/JetBrainsMono.zip mkdir ~\fonts Copy-Item ~\JetBrainsMono.zip ~\fonts\JetBrainsMono.zip Set-Location ~\fonts | Out-Null unzip JetBrainsMono.zip Remove-Item JetBrainsMono.zip - $UserFonts = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts" - New-Item -ItemType Directory -Path $UserFonts -Force | Out-Null - Get-ChildItem -Filter *.ttf | ForEach-Object { - Invoke-Item $_.FullName + $FontsPath = "~\fonts" + + $shell = New-Object -ComObject Shell.Application + $fonts = $shell.Namespace(0x14) + + Get-ChildItem $FontsPath -Include *.ttf,*.otf -File | ForEach-Object { + $fonts.CopyHere($_.FullName) } Set-Location ~ + Remove-Item ~\fonts -Force -Recurse| Out-Null } Write-Divider