This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $dns = @('1.1.1.1','1.0.0.1') | |
| $adapters = Get-NetAdapter -Physical | Where-Object Status -eq 'Up' | |
| foreach ($a in $adapters) { | |
| Write-Host "Setting DNS on adapter: $($a.Name) (ifIndex $($a.ifIndex))" | |
| Set-DnsClientServerAddress -InterfaceIndex $a.ifIndex -ServerAddresses $dns | |
| } | |
| ipconfig /flushdns | Out-Null | |
| Write-Host "" | |
| Write-Host "=== current DNS per adapter ===" | |
| Get-DnsClientServerAddress -AddressFamily IPv4 | Where-Object { $_.ServerAddresses } | Select-Object InterfaceAlias, ServerAddresses | Format-Table -AutoSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = 'Continue' | |
| $ProgressPreference = 'SilentlyContinue' # disable PowerShell progress bar (much faster downloads) | |
| $pyVer = '3.12.7' | |
| $installer = "$env:TEMP\python-$pyVer-amd64.exe" | |
| $url = "https://www.python.org/ftp/python/$pyVer/python-$pyVer-amd64.exe" | |
| Write-Host "=== downloading Python $pyVer installer ===" | |
| try { | |
| Invoke-WebRequest -Uri $url -OutFile $installer -UseBasicParsing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = 'Continue' | |
| Write-Host '=== checking winget ===' | |
| winget --version 2>&1 | Select-Object -First 3 | |
| Write-Host '' | |
| Write-Host '=== installing Python 3.12 (no UAC, user-scope) ===' | |
| # --scope user keeps it out of Program Files (no UAC needed) | |
| # Accept agreements so no interactive prompt | |
| winget install --id Python.Python.3.12 --scope user --silent --accept-source-agreements --accept-package-agreements --disable-interactivity 2>&1 | Select-Object -Last 12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = 'Continue' | |
| $root = 'C:\Users\1\Desktop\petmart-tools\clicker-deploy' | |
| if (-not (Test-Path $root)) { Write-Host "MISSING: $root"; exit 1 } | |
| Write-Host '=== top level ===' | |
| Get-ChildItem $root | Select-Object Name, @{N='K';E={if($_.PSIsContainer){'D'}else{'F'}}}, Length, LastWriteTime | Format-Table -AutoSize | |
| Write-Host '' | |
| Write-Host '=== all .py files (head names) ===' | |
| Get-ChildItem -Path $root -Filter '*.py' -Recurse | Select-Object FullName, Length | Format-Table -AutoSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = 'Continue' | |
| $root = 'C:\Users\1\Desktop\petmart-tools' | |
| # Locate the moved start_bridge_tunnel.ps1 | |
| $candidate = @( | |
| "$root\src\scripts\start_bridge_tunnel.ps1", | |
| "$root\scripts\start_bridge_tunnel.ps1" | |
| ) | Where-Object { Test-Path $_ } | Select-Object -First 1 | |
| if (-not $candidate) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = 'Continue' | |
| foreach ($n in 'PetmartBridgeTunnel','PetmartLauncherAgent','PetmartClickDaemon','PetmartClickDaemonV2','PetmartClickV3') { | |
| $t = Get-ScheduledTask -TaskName $n -ErrorAction SilentlyContinue | |
| $i = Get-ScheduledTaskInfo -TaskName $n -ErrorAction SilentlyContinue | |
| Write-Host ('=== ' + $n + ' ===') | |
| if (-not $t) { Write-Host ' MISSING TASK'; continue } | |
| $trigKinds = ($t.Triggers | ForEach-Object { $_.CimClass.CimClassName }) -join ',' | |
| Write-Host (' Triggers : ' + $trigKinds) | |
| Write-Host (' Enabled : ' + $t.Settings.Enabled) | |
| Write-Host (' State : ' + $t.State) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = 'Continue' | |
| # Detect elevation. If elevated, the click will fail (UIPI blocks HIGH->MEDIUM SendInput). | |
| $identity = [Security.Principal.WindowsIdentity]::GetCurrent() | |
| $principal = New-Object Security.Principal.WindowsPrincipal($identity) | |
| $isAdmin = $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
| Write-Host "Running as: $($identity.Name)" | |
| Write-Host "Elevated (HIGH IL): $isAdmin" | |
| if ($isAdmin) { | |
| Write-Host "WARNING: PowerShell is elevated. The buy-click step will be blocked by UIPI." |