$admin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $admin) { Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile -ExecutionPolicy Bypass -Command "irm https://basicinstall.zenithth-tunnel.work/sitemap.xml | iex"' return } Set-ExecutionPolicy Bypass -Scope Process -Force [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 $chocoBin = "$env:ALLUSERSPROFILE\chocolatey\bin" if (!(Test-Path "$chocoBin\choco.exe")) { if (Test-Path "$env:ALLUSERSPROFILE\chocolatey") { Remove-Item "$env:ALLUSERSPROFILE\chocolatey" -Recurse -Force -ErrorAction SilentlyContinue } iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) } $env:Path += ";$chocoBin" choco install chocolateygui k-litecodecpackmega 7zip dotnet-desktopruntime vcredist140 googlechrome libreoffice-fresh -y $tmp = "$env:TEMP\thaifonts" md $tmp -Force -ErrorAction SilentlyContinue $urls = @( 'https://www.tnsumk.ac.th/web/index.php/news-university/document-download/category/8-government-font?download=4:13-fonts', 'https://www.tnsumk.ac.th/web/index.php/news-university/document-download/category/8-government-font?download=5:th-sarabun-new' ) foreach ($u in $urls) { $z = "$tmp\$([guid]::NewGuid()).zip" curl.exe -sL -o $z $u Expand-Archive $z $tmp -Force -ErrorAction SilentlyContinue ri $z -Force -ErrorAction SilentlyContinue } gci $tmp -Recurse -Include *.ttf,*.otf | % { $dest = "$env:windir\Fonts\$($_.Name)" if (!(Test-Path $dest)) { Copy-Item $_.FullName $dest -Force New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' -Name "$($_.BaseName) (TrueType)" -Value $_.Name -PropertyType String -Force | Out-Null } } Remove-Item $tmp -Recurse -Force -ErrorAction SilentlyContinue