Tools/Install-BCDevCodaBarFonts.ps1
function Install-BCDevCodaBarFonts { $tempFolder = "$env:TEMP\$([Guid]::newguid().ToString())" New-Item -Path $tempFolder -ItemType Directory -Force | Out-Null $ModulePaths = (Get-module -ListAvailable bricklead.bcdev.tools | Sort-Object Version).Path $Path = [System.IO.Path]::GetDirectoryName($ModulePaths[-1])+'\Resources\IDAutomationFonts.zip' Expand-Archive -Path $Path -Destination $tempFolder try { "" | Set-Content "C:\Windows\Fonts\Test.tmp" -force -ErrorAction Stop Copy-Item -Path "$tempFolder\IDAutomationFonts\IDAutomation*.ttf" -Destination "C:\Windows\Fonts" -Force -ErrorAction Stop Remove-Item -Path "C:\Windows\Fonts\Test.tmp" -force } Catch { Write-Warning "Access Denied to font directory" } finally { Remove-Item -Path $tempFolder -Force -Recurse -ErrorAction SilentlyContinue } } Export-ModuleMember Install-BCDevCodaBarFonts |