# SuwakoSetupAssistant - (c) Bionic Butter function Show-Branding { try {$host.UI.RawUI.WindowTitle = "Suwako Setup Assistant - (c) Bionic Butter $modetitle"} catch {} Clear-Host Write-Host 'Suwako Setup Assistant - Online Windows utilities right from your command-line' -ForegroundColor Black -BackgroundColor Cyan Write-Host "Version 0.1 - (c) Bionic Butter" -ForegroundColor Cyan Write-Host " " } # function Confirm-Exit { # Show-Branding 0 # Write-Host "Are sure you want to exit?" -ForegroundColor Black -BackgroundColor Yellow # Write-Host "Type `"R`" and Enter again to exit." -ForegroundColor Yellow # Write-Host "> " -n; $cexi = Read-Host # if ($cexi -like "r") {return $true} else {return $false} # } Show-Branding Write-Host 'An exiting future is coming' -ForegroundColor Black -BackgroundColor White # "=========================== Console default length limit before you have to make a new line ============================" Write-Host "Soon, from any internet-enabled system with PowerShell 5.x, you will be able bootstrap all your favorite Suwako" -ForegroundColor White Write-Host "utilities on-premises with just a single command:`r`n" -ForegroundColor White Write-Host " powershell `"irm https://gg.osenet.work | iex`"" -ForegroundColor Green Write-Host " (Yep, the same way as how you would invoke MAS)`r`n" -ForegroundColor DarkGray Write-Host "This will enable you to run things like Suwako Debloater, Suwako AutoOBE (OOBE skipper) without having to manually copy" Write-Host "files to the target device, especially when it's on a fresh install and in scenarios like the OOBE and such (hence the" Write-Host "name `"Setup Assistant`")`r`n" Write-Host "For now, only one utility is available. Press 1 and Enter to invoke Browser Downloader or anything else to exit" -ForegroundColor Yellow Write-Host "> " -n; $act = Read-Host if ($act -like "r") {exit} elseif ($act -like "1") {} else {exit} function Start-BrowserDownload { param ( [Parameter(Mandatory=$True,Position=0)] [string]$link, [Parameter(Mandatory=$True,Position=1)] [string]$file ) $dest = "$env:TEMP\${file}" Write-Host "`r`nDownload information:" -ForegroundColor White Write-Host "` - Link: ${link}" -ForegroundColor White Write-Host "` - Saving as: ${dest}" -ForegroundColor White Write-Host "Confirm your selection? (1): " -ForegroundColor Yellow -n; $cfm1 = Read-Host if ($cfm1 -ne "1") {return} Show-Branding Write-Host "Starting the download" -ForegroundColor Cyan -BackgroundColor DarkGray Start-BitsTransfer -DisplayName "Downloading $file" -Description "From $link" -Source $link -Destination $dest if ((Get-Item $dest).Length -ne 0) { Write-Host "`r`nDownload complete. Type `"1`" to open the file, or anything else to return." -ForegroundColor Green Write-Host "> " -n; $cfm2 = Read-Host if ($cfm2 -eq "1") {Invoke-Item $dest} else {return} } else { Write-Host "`r`nDownload failed. Either the link is inaccesible or internet connection is unstable." -ForegroundColor Red Write-Host "Press Enter to return." Read-Host; return } } Set-Alias -Name dl -Value Start-BrowserDownload Import-Module BitsTransfer while ($true) { Show-Branding Write-Host "Browser Downloader" -ForegroundColor Black -BackgroundColor White Write-Host "Only x86_64 installers are available at the moment." -ForegroundColor White Write-Host "Several browsers offer installers in MSI instead of EXE and will have an (i) at the end of their name to indicate such.`r`nIf you prefer, simply add said letter after the number (for example with Firefox, type `"1`" to get an EXE, and `"1i`" for`r`nan MSI)." -ForegroundColor White Write-Host "Downloads will be saved to $env:TEMP" Write-Host "`r`n R. Exit" -ForegroundColor White Write-Host "`r`n Please select a browser:" Write-Host " 1. Mozilla Firefox (i)" -ForegroundColor White Write-Host " 2. Mozilla Firefox ESR (i)" -ForegroundColor White Write-Host " 3. Brave" -ForegroundColor White Write-Host " 4. Google Chrome (i)" -ForegroundColor White Write-Host "`r`n> " -n; $action = Read-Host switch ($action) { "r" {exit} "1" {$link = "https://download.mozilla.org/?product=firefox-latest-ssl&os=win64&lang=en-US"; $file = "FirefoxSetup.exe"} "1i" {$link = "https://download.mozilla.org/?product=firefox-msi-latest-ssl&os=win64&lang=en-US"; $file = "FirefoxSetup.msi"} "2" {$link = "https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=win64&lang=en-US"; $file = "FirefoxESRSetup.exe"} "2i" {$link = "https://download.mozilla.org/?product=firefox-esr-msi-latest-ssl&os=win64&lang=en-US"; $file = "FirefoxESRSetup.msi"} "3" {$link = "https://github.com/brave/brave-browser/releases/latest/download/BraveBrowserStandaloneSetup.exe"; $file = "BraveSetup.exe"} "4" {$link = "https://dl.google.com/dl/chrome/install/ChromeStandaloneSetup64.exe"; $file = "ChromeSetup.exe"} "4i" {$link = "https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise64.msi"; $file = "ChromeSetup.msi"} } if (@("1","1i","2","2i","3","4","4i").Contains($action)) {dl $link $file} }