# IT-Tools launcher: irm | iex # Downloads it.bat to %TEMP% and runs it in a new console window. $ErrorActionPreference = 'Stop' $url = 'https://it.accept-it.ru/bat' # link to it.bat $path = Join-Path $env:TEMP 'it.bat' try { Write-Host 'Downloading IT-Tools...' if (Get-Command curl.exe -ErrorAction SilentlyContinue) { # curl.exe follows https -> http redirects without complaints & curl.exe -sSL --fail -o $path $url if ($LASTEXITCODE -ne 0) { throw "curl exit code $LASTEXITCODE" } } else { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 Invoke-WebRequest -Uri $url -OutFile $path -UseBasicParsing } if (-not (Select-String -Path $path -Pattern '@echo off' -SimpleMatch -Quiet)) { throw 'Downloaded file is not it.bat (check the share link)' } Start-Process -FilePath 'cmd.exe' -ArgumentList "/c `"$path`"" } catch { Write-Host "ERROR: $($_.Exception.Message)" -ForegroundColor Red }