Last active 8 months ago

powershell -ExecutionPolicy Bypass -NoProfile -Command "iex ((New-Object Net.WebClient).DownloadString('https://gist.mxyw.es/mxywes/4d7dc1880d494d89b85d0c5edc228bae/raw/HEAD/one_time_setup.ps1'))"

mxywes revised this gist 8 months ago. Go to revision

No changes

mxywes revised this gist 8 months ago. Go to revision

1 file changed, 1 insertion, 1 deletion

one_time_setup.ps1

@@ -56,4 +56,4 @@ Set-MpPreference -DisableBehaviorMonitoring $true
56 56 Set-MpPreference -DisableBlockAtFirstSeen $true
57 57 Set-MpPreference -SignatureDisableUpdateOnStartupWithoutEngine $true
58 58
59 - Write-Host "`n✅ All tasks completed successfully." -ForegroundColor Green
59 + Write-Host "✅ All tasks completed successfully." -ForegroundColor Green

mxywes revised this gist 8 months ago. Go to revision

1 file changed, 0 insertions, 0 deletions

one_time_setup.bat renamed to one_time_setup.ps1

File renamed without changes

mxywes revised this gist 8 months ago. Go to revision

No changes

mxywes revised this gist 8 months ago. Go to revision

1 file changed, 59 insertions

one_time_setup.bat(file created)

@@ -0,0 +1,59 @@
1 + # Elevate to Administrator if needed
2 + If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
3 + Start-Process powershell.exe "-ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
4 + Exit
5 + }
6 +
7 + # Enable TLS 1.2
8 + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
9 +
10 + # ----- Download All-in-One Runtime Installer (latest release from GitHub) -----
11 + $repoApi = "https://api.github.com/repos/BloopSmasher/All-in-One-Runtime-Installer/releases/latest"
12 + $headers = @{ "User-Agent" = "RuntimeSetupScript" }
13 + $release = Invoke-RestMethod -Uri $repoApi -Headers $headers
14 +
15 + $zipAsset = $release.assets | Where-Object { $_.name -like "*.zip" } | Select-Object -First 1
16 + $zipUrl = $zipAsset.browser_download_url
17 + $zipFile = "All-in-One-Runtime-Installer.zip"
18 + $extractPath = "AllInOneRuntime"
19 +
20 + Write-Host "📦 Downloading latest All-in-One-Runtime-Installer..."
21 + Invoke-WebRequest -Uri $zipUrl -OutFile $zipFile
22 +
23 + Write-Host "📂 Extracting..."
24 + Expand-Archive -Path $zipFile -DestinationPath $extractPath -Force
25 + Remove-Item $zipFile
26 +
27 + # ----- Run the All-in-One Runtime Installer -----
28 + $installerPath = Join-Path $extractPath "All in One Runtime Installer (AutoAdmin).bat"
29 + if (Test-Path $installerPath) {
30 + Write-Host "🚀 Launching All-in-One Runtime Installer..."
31 + Start-Process -FilePath $installerPath -Wait
32 + } else {
33 + Write-Host "⚠️ Could not find All-in-One installer script at: $installerPath" -ForegroundColor Yellow
34 + }
35 +
36 + # ----- Install latest WinGet -----
37 + $apiUrl = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
38 + $assets = (Invoke-RestMethod -Uri $apiUrl -Headers $headers).assets
39 + $wingetUrl = $assets | Where-Object { $_.name -like "*.msixbundle" } | Select-Object -ExpandProperty browser_download_url
40 +
41 + Write-Host "⬇️ Installing WinGet..."
42 + Invoke-WebRequest -Uri $wingetUrl -OutFile "winget.msixbundle"
43 + Add-AppxPackage ".\winget.msixbundle"
44 + Remove-Item "winget.msixbundle"
45 +
46 + # ----- Install desired apps with WinGet -----
47 + winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
48 + winget install synctrayzor --accept-package-agreements --accept-source-agreements
49 + winget install windirstat --accept-package-agreements --accept-source-agreements
50 + winget install 7zip.7zip --accept-package-agreements --accept-source-agreements
51 + winget install qBittorrent.qBittorrent --accept-package-agreements --accept-source-agreements
52 +
53 + # ----- Disable Defender protection features -----
54 + Set-MpPreference -DisableRealtimeMonitoring $true
55 + Set-MpPreference -DisableBehaviorMonitoring $true
56 + Set-MpPreference -DisableBlockAtFirstSeen $true
57 + Set-MpPreference -SignatureDisableUpdateOnStartupWithoutEngine $true
58 +
59 + Write-Host "`n✅ All tasks completed successfully." -ForegroundColor Green
Newer Older