Last active
April 16, 2019 12:15
-
-
Save supernovel/9096dce248d3c16ea546b8a9ed94af54 to your computer and use it in GitHub Desktop.
윈도우 nerdfont 설치(install nerdfont(DejaVuSansMono) for powershell)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[CmdletBinding(SupportsShouldProcess)] | |
#param() | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
$fontName='DejaVuSansMono' | |
$currentDirectory = (Get-Location).Path | |
# Download fonts | |
$fontZipName = Join-Path "$currentDirectory" "$fontName.zip" | |
$fontDirectory = Join-Path "$currentDirectory" "$fontName" | |
echo "Download $fontName" | |
(new-object Net.WebClient).DownloadFile("https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/$fontName.zip", "$fontZipName") | |
# Unzip | |
echo "Unzip $fontName" | |
Expand-Archive "$fontZipName" -DestinationPath "$fontDirectory" | |
# Apply fonts | |
$shellApp = New-Object -ComObject shell.application | |
$fonts = $shellApp.NameSpace(0x14) | |
echo 'Copy font' | |
$fontFiles = New-Object 'System.Collections.Generic.List[System.IO.FileInfo]' | |
Get-ChildItem "$fontDirectory" -Recurse | Where-Object {$_.Name -match '^.*Windows.*\.ttf$'} | Foreach-Object {$fontFiles.Add($_)} | |
foreach ($fontFile in $fontFiles) { | |
#if ($PSCmdlet.ShouldProcess($fontFile.Name, "Install Font")) { | |
echo "Copy $fontFile" | |
$fonts.CopyHere($fontFile.FullName) | |
#} | |
} | |
# Clean | |
rm -R "$fontDirectory" | |
rm $fontZipName | |
# Run install zsh script | |
#bash -c "curl -sL https://gist.githubusercontent.com/supernovel/ba381b31eaa53576c153501634859904/raw/d37c14206cf276dde42fa4374075dc0e7dbcd5af/install.sh | sudo -E bash -" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('raw url')"
powershell -nop -c "iex(New-Object Net.WebClient).DownloadString('https://gist.githubusercontent.com/supernovel/9096dce248d3c16ea546b8a9ed94af54/raw/b0245c70593191f59174417d6d44eea60d74a0dd/install.ps1')"