I want to make an unattended Windows 10 x64 LTSC (1809). I've installed a number of fonts with Powershell via the Powershell script in the following repository: here
That worked fine, but that work just in the current user. when I trying to create a new user, I can't see my new fonts. New fonts are only installed on the current user. But I want them to be installed on all users.
Windows had two option to install fonts in current user Or all users:
I think this script just install fonts in current user and should be had a command to install in all users. This is my Power-Shell Command:
$SourceDir = "InstallFont\"
$Source = "InstallFont\*"
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
$TempFolder = "C:\Windows\Temp\Fonts"
New-Item -ItemType Directory -Force -Path $SourceDir
New-Item $TempFolder -Type Directory -Force | Out-Null
Get-ChildItem -Path $Source -Include '*.ttf','*.ttc','*.otf' -Recurse | ForEach {
If (-not(Test-Path "C:\Windows\Fonts\$($_.Name)")) {
$Font = "$TempFolder\$($_.Name)"
# Copy font to local temporary folder
Copy-Item $($_.FullName) -Destination $TempFolder
# Install font
$Destination.CopyHere($Font,0x10)
# Delete temporary copy of font
Remove-Item $Font -Force
}
}
So how will change this code or is there a way to install new fonts in all users in PowerShell. Any help is appreciated.