# RulesToolkit loader. ASCII only, no BOM. # Usage: irm https://win.masuda.tech | iex # Downloads RulesToolkit.ps1 as raw bytes and decodes it as UTF-8 explicitly, # so Cyrillic text survives regardless of the Content-Type charset of the web server. & { $ErrorActionPreference = 'Stop' try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 } catch {} $src = 'https://rules.tool.masuda.tech/RulesToolkit.ps1' if ($env:RULESTOOLKIT_SRC) { $src = $env:RULESTOOLKIT_SRC } Write-Host "RulesToolkit: downloading $src" -ForegroundColor DarkGray $wc = New-Object System.Net.WebClient $wc.Headers['User-Agent'] = 'RulesToolkit-loader' $bytes = $wc.DownloadData($src) $code = [System.Text.Encoding]::UTF8.GetString($bytes).TrimStart([char]0xFEFF) if ($code -notmatch 'function Start-RulesMenu') { throw 'RulesToolkit: downloaded file is not RulesToolkit.ps1' } & ([scriptblock]::Create($code)) }