Jump to content

Recommended Posts

Posted

You can do this through sccm if you use it.

 

I can dig out batch script if so

Posted
If it is a very tight security environment I doubt you will be able to run a random script. You'd be better off looking at implementing web fonts (can't remember the exact term) so you don't need to install the fonts.

 

I do need the downloaded files to be able to create prototypes in Photoshop. But I see what you're saying, I probably would not be able to do it myself. I was hoping to understand more about the script to relay to IT, they can be quite hard to deal with.

Posted
Is there a way to allow staff to install fonts without admin rights?

Give them all Macs? :p

 

It's a shame Microsoft didn't copy OS X and create a user-specific font folder like ~/Library/Fonts where they don't need admin rights. :(

Posted
Give them all Macs? :p

 

It's a shame Microsoft didn't copy OS X and create a user-specific font folder like ~/Library/Fonts where they don't need admin rights. :(

 

Ahh I wish so badly this was the case. I've tried to make the case for a Mac but am constantly thwarted by IT because they don't want to support it

  • 1 month later...
Posted (edited)
I'm not having much luck with the script at the moment... It copies the file over but doesn't do the install. I'll keep playing.

I'm not sure if you eventually discovered this, but when installing fonts under the local SYSTEM account with 'Shell.Application', the file extension gets removed preventing Windows from installing the font.

 

More details on why this happens: https://beingwinsysadmin.blogspot.com/2017/11/powershell-installing-fonts-hard-way.html (it's a feature, not a bug! :p)

 

Here's a working PowerShell script (based on the script in the linked article)...

 

$Shell = New-Object -ComObject Shell.Application
ForEach ($Font in $Shell.Namespace($PSScriptRoot).Items()) {

   $FileName = [iO.Path]::GetFileName($Font.Path)

   if ($FileName -match '\.(ttf|otf|pfm|fon)$') {

       if (-not(Test-Path ($env:windir + "\Fonts\" + $FileName) -ErrorAction SilentlyContinue)) {

           $Font.InvokeVerbEx("Install")

       }

   }

}

Edited by Arthur
  • Thanks 2
Posted
Is the bug that you're using Shell.Items, not get-childitem?

How would you do the "InvokeVerbEx" bit with Get-ChildItem? :confused:

 

Just copying the fonts into the Windows fonts folder isn't the correct way of installing fonts.

Posted
Good point, I guess you'd have to call GetFolderItem with the path from get-childitem, at which point the parsing of the path is about as easy
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...