FontInstaller
v0.0.3
Windows的字體安裝程序腳本

要安裝字體,只需將字體文件的路徑指定為第一個參數即可。該腳本自動解決路徑,因此您可以指定通配符,例如*.ttf 。
❯ Install-Font.ps1 Somefont / # Directory path
❯ Install-Font.ps1 path / to / SomeFont * .ttf # File path includes wild card當此腳本找到zip文件時,它會自動將zip文件提取到臨時目錄並安裝存儲在其中的所有字體。
❯ Install-Font.ps1 Somefont.zip要查看已經安裝的字體的列表,請運行Get-Font.ps1 。您可以通過指定-Name , -Path參數來縮小列表。
❯ Get-Font.ps1 -Name udev
Name Path
---- ----
UDEV Gothic 35NF C:WindowsFontsUDEV Gothic 35NF
UDEV Gothic 35NFLG C:WindowsFontsUDEV Gothic 35NFLG
UDEV Gothic NF C:WindowsFontsUDEV Gothic NF
UDEV Gothic NFLG C:WindowsFontsUDEV Gothic NFLG
克隆或下載此存儲庫。否則,從最新版本的頁面下載存檔,然後將其提取。
要在Windows上運行本地PowerShell腳本,需要更改執行策略更改。在使用此腳本之前在下面運行。關閉控制台時會損失更改
Set-ExecutionPolicy RemoteSigned - Scope Process如果您想更改計算機設置並使它們持久,請使用管理員特權運行以下內容。
# PowerShell (Administrator)
Set-ExecutionPolicy RemoteSigned - Scope CurrentUser麻省理工學院