Set-StrictMode -Version 2.0 $ErrorActionPreference = "Continue" $Script:LogDir = Join-Path $env:USERPROFILE "Desktop\PS-Multitool-Logs" $Script:LogFile = Join-Path $Script:LogDir "multitool.log" New-Item -ItemType Directory -Path $Script:LogDir -Force | Out-Null $Script:History = [System.Collections.Generic.List[int]]::new() $Script:FavFile = Join-Path $Script:LogDir "favorites.txt" function Write-Log { param([string]$Message) $line = "[{0}] {1}" -f (Get-Date -Format "yyyy-MM-dd HH:mm:ss"), $Message Add-Content -Path $Script:LogFile -Value $line } function Pause-Tool { Write-Host "" Read-Host "Press Enter to continue" | Out-Null } function Is-Admin { $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = New-Object Security.Principal.WindowsPrincipal($identity) return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) } function Need-Admin { if (-not (Is-Admin)) { Write-Host "This feature requires Administrator. Restart PowerShell as Administrator." -ForegroundColor Yellow return $false } return $true } function Confirm-Destructive { param([string]$Action) $v = Read-Host "Are you sure you want to $Action? (yes/no)" return ($v -match '^yes$') } function Run-Cmd { param([Parameter(Mandatory)][string]$Command) Write-Log "Running: $Command" cmd.exe /c $Command } function Open-PathSafe { param([Parameter(Mandatory)][string]$Path) if (Test-Path $Path) { Start-Process $Path } else { Write-Host "Not found: $Path" -ForegroundColor Yellow } } function Header { Clear-Host Write-Host "============================================================" -ForegroundColor Cyan Write-Host " cv2.im Powershell Multitool " -ForegroundColor Cyan Write-Host "============================================================" -ForegroundColor Cyan Write-Host "Log: $Script:LogFile" Write-Host "Admin: $(if (Is-Admin) { 'Yes' } else { 'No' })" Write-Host "" } function Invoke-Feature { param([hashtable]$Feature) Write-Log "Selected feature $($Feature['N']): $($Feature['T'])" $Script:History.Add([int]$Feature['N']) try { & $Feature['F'] } catch { Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red; Write-Log "Error: $($_.Exception.Message)" } Pause-Tool } function Load-Favorites { if (Test-Path $Script:FavFile) { Get-Content $Script:FavFile | Where-Object { $_ -match '^\d+$' } | ForEach-Object { [int]$_ } } else { @() } } function Save-Favorites { param([int[]]$Favs) $Favs | Sort-Object -Unique | Set-Content $Script:FavFile } function Show-SystemSummary { Get-ComputerInfo | Select-Object CsName, WindowsProductName, WindowsVersion, OsBuildNumber, OsArchitecture, CsManufacturer, CsModel, CsProcessors, CsTotalPhysicalMemory | Format-List } function Show-OSInfo { Get-CimInstance Win32_OperatingSystem | Format-List Caption, Version, BuildNumber, OSArchitecture, InstallDate, LastBootUpTime, SerialNumber } function Show-BIOSInfo { Get-CimInstance Win32_BIOS | Format-List Manufacturer, SMBIOSBIOSVersion, ReleaseDate, SerialNumber } function Show-CPUInfo { Get-CimInstance Win32_Processor | Select-Object Name, Manufacturer, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed | Format-Table -AutoSize } function Show-RAMInfo { Get-CimInstance Win32_PhysicalMemory | Select-Object BankLabel, Manufacturer, Capacity, Speed, PartNumber | Format-Table -AutoSize } function Show-GPUInfo { Get-CimInstance Win32_VideoController | Select-Object Name, DriverVersion, AdapterRAM, VideoModeDescription | Format-Table -AutoSize } function Show-DiskInfo { Get-CimInstance Win32_DiskDrive | Select-Object Model, MediaType, Size, InterfaceType, Status | Format-Table -AutoSize } function Show-VolumeInfo { Get-Volume | Sort-Object DriveLetter | Format-Table DriveLetter, FileSystemLabel, FileSystem, SizeRemaining, Size, HealthStatus -AutoSize } function Show-BatteryInfo { Get-CimInstance Win32_Battery | Format-List Name, BatteryStatus, EstimatedChargeRemaining, EstimatedRunTime } function Show-MotherboardInfo{ Get-CimInstance Win32_BaseBoard | Format-List Manufacturer, Product, Version, SerialNumber } function Show-Uptime { $os=Get-CimInstance Win32_OperatingSystem; New-TimeSpan -Start $os.LastBootUpTime -End (Get-Date) | Format-List } function Show-LoggedInUsers { quser 2>$null; if ($LASTEXITCODE -ne 0) { Get-CimInstance Win32_ComputerSystem | Select-Object UserName } } function Show-EnvironmentVariables { Get-ChildItem Env: | Sort-Object Name | Format-Table -AutoSize } function Show-InstalledPrograms { Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* -ErrorAction SilentlyContinue | Where-Object DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Sort-Object DisplayName | Format-Table -AutoSize } function Show-WindowsFeatures { if (Need-Admin) { Get-WindowsOptionalFeature -Online | Sort-Object State, FeatureName | Format-Table FeatureName, State -AutoSize } } function Show-Hotfixes { Get-HotFix | Sort-Object InstalledOn -Descending | Format-Table -AutoSize } function Show-Drivers { Get-CimInstance Win32_PnPSignedDriver | Select-Object DeviceName, DriverVersion, Manufacturer, DriverDate | Sort-Object DeviceName | Format-Table -AutoSize } function Show-StartupApps { Get-CimInstance Win32_StartupCommand | Select-Object Name, Command, Location, User | Format-Table -Wrap } function Show-ScheduledTasks { Get-ScheduledTask | Select-Object TaskName, TaskPath, State | Format-Table -AutoSize } function Show-EventErrors { Get-WinEvent -FilterHashtable @{LogName='System'; Level=2; StartTime=(Get-Date).AddDays(-3)} -MaxEvents 50 | Format-Table TimeCreated, ProviderName, Id, Message -Wrap } function Export-SystemReport { $path=Join-Path $Script:LogDir "SystemReport_$((Get-Date).ToString('yyyyMMdd_HHmmss')).txt"; Get-ComputerInfo | Out-File $path; Write-Host "Saved: $path" -ForegroundColor Green } function Show-IPConfig { Get-NetIPConfiguration | Format-List } function Show-NetworkAdapters { Get-NetAdapter | Format-Table Name, InterfaceDescription, Status, LinkSpeed, MacAddress -AutoSize } function Show-WiFiProfiles { netsh wlan show profiles } function Show-WiFiPassword { $name=Read-Host "Wi-Fi profile name"; netsh wlan show profile name="$name" key=clear } function Test-PingHost { $h=Read-Host "Host/IP"; Test-Connection $h -Count 4 } function Trace-RouteHost { $h=Read-Host "Host/IP"; tracert $h } function Resolve-DNSNameTool { $h=Read-Host "Domain"; Resolve-DnsName $h } function Show-DNSCache { Get-DnsClientCache | Format-Table -AutoSize } function Clear-DNSCacheTool { if (Need-Admin) { Clear-DnsClientCache; Write-Host "DNS cache cleared." -ForegroundColor Green } } function Show-OpenPorts { Get-NetTCPConnection | Sort-Object LocalPort | Format-Table LocalAddress, LocalPort, RemoteAddress, RemotePort, State, OwningProcess -AutoSize } function Show-ListeningPorts { Get-NetTCPConnection -State Listen | Sort-Object LocalPort | Format-Table LocalAddress, LocalPort, OwningProcess -AutoSize } function Show-RoutingTable { route print } function Show-ARPTable { arp -a } function Show-FirewallProfiles{ Get-NetFirewallProfile | Format-Table Name, Enabled, DefaultInboundAction, DefaultOutboundAction -AutoSize } function Toggle-Firewall { if (Need-Admin) { $v=Read-Host "Enable firewall? y/n"; Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled ($(if($v -match '^y'){'True'}else{'False'})) } } function Show-NetShares { Get-SmbShare | Format-Table -AutoSize } function Show-NetConnections { net use } function ReleaseRenewIP { if (Need-Admin) { ipconfig /release; ipconfig /renew } } function Reset-NetworkStack { if (Need-Admin) { netsh winsock reset; netsh int ip reset; Write-Host "Restart recommended." -ForegroundColor Yellow } } function SpeedTestHint { Write-Host "Install Ookla Speedtest CLI or use: winget install Ookla.Speedtest.CLI" } function Show-PublicIP { try { (Invoke-RestMethod -Uri "https://api.ipify.org?format=text" -TimeoutSec 10) } catch { Write-Host "Could not fetch public IP." -ForegroundColor Yellow } } function Port-Test { $h=Read-Host "Host"; $p=Read-Host "Port"; Test-NetConnection -ComputerName $h -Port ([int]$p) } function Show-ProxySettings { netsh winhttp show proxy; Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' | Select-Object ProxyEnable, ProxyServer } function Flush-NetBIOS { if (Need-Admin) { nbtstat -R; nbtstat -RR } } function List-Processes { Get-Process | Sort-Object CPU -Descending | Select-Object -First 50 | Format-Table Id, ProcessName, CPU, WorkingSet -AutoSize } function Kill-ProcessByName { $n=Read-Host "Process name"; Stop-Process -Name $n -Force -ErrorAction Continue } function Kill-ProcessById { $id=Read-Host "PID"; Stop-Process -Id ([int]$id) -Force -ErrorAction Continue } function List-Services { Get-Service | Sort-Object Status, Name | Format-Table Name, DisplayName, Status -AutoSize } function Start-ServiceTool { $n=Read-Host "Service name"; Start-Service $n } function Stop-ServiceTool { if (Need-Admin) { $n=Read-Host "Service name"; Stop-Service $n -Force } } function Restart-ServiceTool { if (Need-Admin) { $n=Read-Host "Service name"; Restart-Service $n -Force } } function Set-ServiceStartup { if (Need-Admin) { $n=Read-Host "Service name"; $t=Read-Host "Startup type Automatic/Manual/Disabled"; Set-Service $n -StartupType $t } } function TaskManager { Start-Process taskmgr } function ResourceMonitor { Start-Process resmon } function PerformanceMonitor { Start-Process perfmon } function DeviceManager { Start-Process devmgmt.msc } function DiskManagement { Start-Process diskmgmt.msc } function EventViewer { Start-Process eventvwr.msc } function ServicesConsole { Start-Process services.msc } function ComputerManagement { Start-Process compmgmt.msc } function RegistryEditor { if (Need-Admin) { Start-Process regedit } } function GroupPolicyEditor { Start-Process gpedit.msc } function LocalUsersGroups { Start-Process lusrmgr.msc } function SystemConfiguration { Start-Process msconfig } function DirectXDiag { Start-Process dxdiag } function ReliabilityMonitor { Start-Process perfmon.exe -ArgumentList "/rel" } function CurrentDirectory { Get-Location } function ChangeDirectory { $p=Read-Host "Path"; Set-Location $p } function ListDirectory { $p=Read-Host "Path (blank=current)"; if([string]::IsNullOrWhiteSpace($p)){$p='.'}; Get-ChildItem $p -Force | Format-Table Mode, Length, LastWriteTime, Name -AutoSize } function TreeView { $p=Read-Host "Path (blank=current)"; if([string]::IsNullOrWhiteSpace($p)){$p='.'}; tree $p /F } function SearchFiles { $p=Read-Host "Path"; $q=Read-Host "Name pattern e.g. *.log"; Get-ChildItem $p -Recurse -Filter $q -ErrorAction SilentlyContinue | Select-Object FullName, Length, LastWriteTime } function FindTextInFiles { $p=Read-Host "Path"; $q=Read-Host "Text"; Select-String -Path (Join-Path $p '*') -Pattern $q -Recurse -ErrorAction SilentlyContinue } function CopyFileTool { $s=Read-Host "Source"; $d=Read-Host "Destination"; Copy-Item $s $d -Recurse -Force } function MoveFileTool { $s=Read-Host "Source"; $d=Read-Host "Destination"; Move-Item $s $d -Force } function DeleteFileTool { $p=Read-Host "Path to delete"; if (Confirm-Destructive "delete '$p'") { Remove-Item $p -Recurse -Force } else { Write-Host "Cancelled." -ForegroundColor Yellow } } function NewFolderTool { $p=Read-Host "New folder path"; New-Item -ItemType Directory -Path $p -Force } function FileHashTool { $p=Read-Host "File path"; Get-FileHash $p -Algorithm SHA256 } function CompressZipTool { $s=Read-Host "Source path"; $d=Read-Host "Zip destination"; Compress-Archive -Path $s -DestinationPath $d -Force } function ExtractZipTool { $s=Read-Host "Zip path"; $d=Read-Host "Destination folder"; Expand-Archive -Path $s -DestinationPath $d -Force } function CleanTempFiles { if (Need-Admin) { if (Confirm-Destructive "clean temp files") { Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue; Write-Host "Temp cleanup attempted." -ForegroundColor Green } else { Write-Host "Cancelled." -ForegroundColor Yellow } } } function EmptyRecycleBinTool { if (Confirm-Destructive "empty the Recycle Bin") { Clear-RecycleBin -Force -ErrorAction Continue } else { Write-Host "Cancelled." -ForegroundColor Yellow } } function LargeFilesFinder { $p=Read-Host "Path"; Get-ChildItem $p -Recurse -File -ErrorAction SilentlyContinue | Sort-Object Length -Descending | Select-Object -First 50 FullName, Length | Format-Table -AutoSize } function RecentFiles { Get-ChildItem $env:USERPROFILE -Recurse -File -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 50 FullName, LastWriteTime } function OpenHostsFile { if (Need-Admin) { notepad C:\Windows\System32\drivers\etc\hosts } } function OpenStartupFolder { Start-Process "shell:startup" } function BackupFolderSimple{ $s=Read-Host "Source folder"; $d=Read-Host "Backup destination folder"; robocopy $s $d /MIR /R:1 /W:1 } function DiskUsageByFolder { $p=Read-Host "Path"; Get-ChildItem $p -Directory -ErrorAction SilentlyContinue | ForEach-Object { $sum=(Get-ChildItem $_.FullName -Recurse -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum; [pscustomobject]@{Folder=$_.FullName; GB=[math]::Round($sum/1GB,2)} } | Sort-Object GB -Descending } function Show-DiskHealth { Get-PhysicalDisk | Select-Object FriendlyName, MediaType, HealthStatus, OperationalStatus, @{N='Size(GB)';E={[math]::Round($_.Size/1GB,1)}} | Format-Table -AutoSize } function Show-OpenPortsNamed { Get-NetTCPConnection | Sort-Object LocalPort | ForEach-Object { $proc = try { (Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName } catch { '?' } [pscustomobject]@{ LocalAddress = $_.LocalAddress LocalPort = $_.LocalPort RemoteAddress = $_.RemoteAddress RemotePort = $_.RemotePort State = $_.State PID = $_.OwningProcess Process = $proc } } | Format-Table -AutoSize } function Show-FailedLogins { if (Need-Admin) { Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 -ErrorAction SilentlyContinue | Select-Object TimeCreated, Message | Format-Table -Wrap } } function Show-FilePermissions { $p = Read-Host "Path" Get-Acl $p | Format-List } function Find-DuplicateFiles { $p = Read-Host "Path to scan" Write-Host "Scanning for duplicates by hash (may take a while)..." -ForegroundColor Cyan Get-ChildItem $p -Recurse -File -ErrorAction SilentlyContinue | Group-Object -Property { (Get-FileHash $_.FullName -Algorithm MD5 -ErrorAction SilentlyContinue).Hash } | Where-Object { $_.Count -gt 1 } | ForEach-Object { Write-Host "-- Duplicate group ($(($_.Group | Measure-Object Length -Sum).Sum / 1KB) KB each) --" -ForegroundColor Yellow $_.Group | Select-Object FullName, Length | Format-Table -AutoSize } } function Bulk-RenameFiles { $p = Read-Host "Folder path" $filter = Read-Host "File filter (e.g. *.txt)" $find = Read-Host "Text to find in filename" $replace = Read-Host "Replace with" $files = Get-ChildItem $p -Filter $filter -ErrorAction SilentlyContinue if ($files.Count -eq 0) { Write-Host "No files matched." -ForegroundColor Yellow; return } Write-Host "Preview of renames:" -ForegroundColor Cyan $files | Where-Object { $_.Name -like "*$find*" } | ForEach-Object { $newName = $_.Name -replace [regex]::Escape($find), $replace Write-Host " $($_.Name) -> $newName" } if (Confirm-Destructive "rename these files") { $files | Where-Object { $_.Name -like "*$find*" } | ForEach-Object { $newName = $_.Name -replace [regex]::Escape($find), $replace Rename-Item $_.FullName -NewName $newName -ErrorAction Continue } Write-Host "Done." -ForegroundColor Green } else { Write-Host "Cancelled." -ForegroundColor Yellow } } function Export-LastResult { $n = Read-Host "Feature number to run and export" if ($n -notmatch '^\d+$') { Write-Host "Invalid number." -ForegroundColor Yellow; return } $feature = $Script:AllFeatures | Where-Object { $_ -is [hashtable] -and $_['N'] -eq [int]$n } if ($null -eq $feature) { Write-Host "Feature not found." -ForegroundColor Yellow; return } $outFile = Join-Path $Script:LogDir "Export_$($feature['N'])_$((Get-Date).ToString('yyyyMMdd_HHmmss')).txt" Write-Host "Running and exporting to: $outFile" -ForegroundColor Cyan & $feature['F'] | Tee-Object -FilePath $outFile Write-Host "Saved: $outFile" -ForegroundColor Green } function OpenSettings { Start-Process ms-settings: } function OpenDisplaySettings { Start-Process ms-settings:display } function OpenSoundSettings { Start-Process ms-settings:sound } function OpenNetworkSettings { Start-Process ms-settings:network } function OpenAppsSettings { Start-Process ms-settings:appsfeatures } function OpenStartupSettings { Start-Process ms-settings:startupapps } function OpenWindowsUpdate { Start-Process ms-settings:windowsupdate } function OpenPrivacySettings { Start-Process ms-settings:privacy } function OpenPowerSettings { Start-Process ms-settings:powersleep } function OpenBluetoothSettings{ Start-Process ms-settings:bluetooth } function DarkModeToggle { $v=Read-Host "Dark mode? y/n"; $d=if($v -match '^y'){0}else{1}; Set-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value $d; Set-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -Value $d } function ShowHiddenFilesToggle{ $v=Read-Host "Show hidden files? y/n"; Set-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name Hidden -Value ($(if($v -match '^y'){1}else{2})); Stop-Process -Name explorer -Force } function ShowFileExtensionsToggle { $v=Read-Host "Show file extensions? y/n"; Set-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -Value ($(if($v -match '^y'){0}else{1})); Stop-Process -Name explorer -Force } function RestartExplorer { Stop-Process -Name explorer -Force } function ChangeComputerName { if (Need-Admin) { $n=Read-Host "New computer name"; Rename-Computer -NewName $n -Force; Write-Host "Restart required." -ForegroundColor Yellow } } function Set-TimeZoneTool { $tz=Read-Host "Time zone id e.g. Eastern Standard Time"; Set-TimeZone -Id $tz } function List-TimeZonesTool { Get-TimeZone -ListAvailable | Format-Table Id, DisplayName -AutoSize } function PowerPlanList { powercfg /L } function SetHighPerformance { if (Need-Admin) { powercfg /S SCHEME_MIN } } function BatteryReport { $p=Join-Path $Script:LogDir "battery-report.html"; powercfg /batteryreport /output $p; Start-Process $p } function EnergyReport { if (Need-Admin) { $p=Join-Path $Script:LogDir "energy-report.html"; powercfg /energy /output $p; Start-Process $p } } function ScreenshotFolder { Open-PathSafe (Join-Path $env:USERPROFILE "Pictures\Screenshots") } function WallpaperSet { $p = Read-Host "Image path" if (-not (Test-Path $p)) { Write-Host "Image not found: $p" -ForegroundColor Yellow; return } $code = @" using System.Runtime.InteropServices; public class W { [DllImport("user32.dll", SetLastError=true)] public static extern bool SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni); } "@ Add-Type -TypeDefinition $code -ErrorAction SilentlyContinue [W]::SystemParametersInfo(20, 0, $p, 3) | Out-Null Write-Host "Wallpaper set." -ForegroundColor Green } function LockComputer { rundll32.exe user32.dll,LockWorkStation } function ClipboardText { Get-Clipboard } function SetClipboardText{ $t=Read-Host "Text"; Set-Clipboard $t } function SFCScan { if (Need-Admin) { sfc /scannow } } function DISMHealth { if (Need-Admin) { DISM /Online /Cleanup-Image /RestoreHealth } } function CheckDisk { if (Need-Admin) { $d=Read-Host "Drive letter e.g. C:"; chkdsk $d /scan } } function WindowsMemoryDiagnostic{ Start-Process mdsched.exe } function DefenderQuickScan { Start-MpScan -ScanType QuickScan } function DefenderFullScan { Start-MpScan -ScanType FullScan } function DefenderStatus { Get-MpComputerStatus | Format-List } function UpdateDefender { Update-MpSignature } function WindowsUpdateHistory { Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 50 | Format-Table -AutoSize } function GenerateWiFiReport { if (Need-Admin) { netsh wlan show wlanreport; Start-Process "$env:ProgramData\Microsoft\Windows\WlanReport\wlan-report-latest.html" } } function SleepStudy { if (Need-Admin) { $p=Join-Path $Script:LogDir "sleepstudy.html"; powercfg /sleepstudy /output $p; Start-Process $p } } function BootConfig { bcdedit } function SystemRestorePoint { if (Need-Admin) { Checkpoint-Computer -Description "PS Multitool Restore Point" -RestorePointType MODIFY_SETTINGS } } function ListRestorePoints { Get-ComputerRestorePoint | Format-Table -AutoSize } function ExportEventLogs { $p=Join-Path $Script:LogDir "SystemEvents_$((Get-Date).ToString('yyyyMMdd_HHmmss')).evtx"; wevtutil epl System $p; Write-Host "Saved: $p" -ForegroundColor Green } function AppxPackages { Get-AppxPackage | Select-Object Name, PackageFullName | Sort-Object Name | Format-Table -AutoSize } function WingetList { winget list } function WingetUpgradeAll { winget upgrade --all } function OpenSafeModeOptions { if (Need-Admin) { Start-Process msconfig } } function RebootTool { if (Confirm-Destructive "reboot") { Restart-Computer } else { Write-Host "Cancelled." -ForegroundColor Yellow } } function ShutdownTool { if (Confirm-Destructive "shut down") { Stop-Computer } else { Write-Host "Cancelled." -ForegroundColor Yellow } } function SignOutTool { if (Confirm-Destructive "sign out") { shutdown /l } else { Write-Host "Cancelled." -ForegroundColor Yellow } } function OpenCommandPrompt { Start-Process cmd.exe } function OpenPowerShellAdmin { Start-Process powershell.exe -Verb RunAs } function OpenTerminal { Start-Process wt.exe -ErrorAction SilentlyContinue } $Features = @( @{N=1; T='System summary'; F='Show-SystemSummary'}, @{N=2; T='OS info'; F='Show-OSInfo'}, @{N=3; T='BIOS info'; F='Show-BIOSInfo'}, @{N=4; T='CPU info'; F='Show-CPUInfo'}, @{N=5; T='RAM info'; F='Show-RAMInfo'}, @{N=6; T='GPU info'; F='Show-GPUInfo'}, @{N=7; T='Disk info'; F='Show-DiskInfo'}, @{N=8; T='Volume info'; F='Show-VolumeInfo'}, @{N=9; T='Battery info'; F='Show-BatteryInfo'}, @{N=10; T='Motherboard info'; F='Show-MotherboardInfo'}, @{N=11; T='Uptime'; F='Show-Uptime'}, @{N=12; T='Logged-in users'; F='Show-LoggedInUsers'}, @{N=13; T='Environment variables'; F='Show-EnvironmentVariables'}, @{N=14; T='Installed programs'; F='Show-InstalledPrograms'}, @{N=15; T='Windows optional features'; F='Show-WindowsFeatures'}, @{N=16; T='Hotfixes'; F='Show-Hotfixes'}, @{N=17; T='Drivers'; F='Show-Drivers'}, @{N=18; T='Startup apps'; F='Show-StartupApps'}, @{N=19; T='Scheduled tasks'; F='Show-ScheduledTasks'}, @{N=20; T='Recent system errors'; F='Show-EventErrors'}, @{N=21; T='Export system report'; F='Export-SystemReport'}, @{N=22; T='IP configuration'; F='Show-IPConfig'}, @{N=23; T='Network adapters'; F='Show-NetworkAdapters'}, @{N=24; T='Wi-Fi profiles'; F='Show-WiFiProfiles'}, @{N=25; T='Show Wi-Fi password'; F='Show-WiFiPassword'}, @{N=26; T='Ping host'; F='Test-PingHost'}, @{N=27; T='Traceroute host'; F='Trace-RouteHost'}, @{N=28; T='DNS lookup'; F='Resolve-DNSNameTool'}, @{N=29; T='DNS cache'; F='Show-DNSCache'}, @{N=30; T='Clear DNS cache'; F='Clear-DNSCacheTool'}, @{N=31; T='Open TCP connections'; F='Show-OpenPorts'}, @{N=32; T='Listening ports'; F='Show-ListeningPorts'}, @{N=33; T='Routing table'; F='Show-RoutingTable'}, @{N=34; T='ARP table'; F='Show-ARPTable'}, @{N=35; T='Firewall profiles'; F='Show-FirewallProfiles'}, @{N=36; T='Toggle firewall'; F='Toggle-Firewall'}, @{N=37; T='SMB shares'; F='Show-NetShares'}, @{N=38; T='Mapped network connections';F='Show-NetConnections'}, @{N=39; T='Release/renew IP'; F='ReleaseRenewIP'}, @{N=40; T='Reset network stack'; F='Reset-NetworkStack'}, @{N=41; T='Speedtest CLI hint'; F='SpeedTestHint'}, @{N=42; T='Public IP'; F='Show-PublicIP'}, @{N=43; T='Test TCP port'; F='Port-Test'}, @{N=44; T='Proxy settings'; F='Show-ProxySettings'}, @{N=45; T='Flush NetBIOS cache'; F='Flush-NetBIOS'}, @{N=46; T='List processes'; F='List-Processes'}, @{N=47; T='Kill process by name'; F='Kill-ProcessByName'}, @{N=48; T='Kill process by PID'; F='Kill-ProcessById'}, @{N=49; T='List services'; F='List-Services'}, @{N=50; T='Start service'; F='Start-ServiceTool'}, @{N=51; T='Stop service'; F='Stop-ServiceTool'}, @{N=52; T='Restart service'; F='Restart-ServiceTool'}, @{N=53; T='Set service startup'; F='Set-ServiceStartup'}, @{N=54; T='Open Task Manager'; F='TaskManager'}, @{N=55; T='Open Resource Monitor'; F='ResourceMonitor'}, @{N=56; T='Open Performance Monitor'; F='PerformanceMonitor'}, @{N=57; T='Open Device Manager'; F='DeviceManager'}, @{N=58; T='Open Disk Management'; F='DiskManagement'}, @{N=59; T='Open Event Viewer'; F='EventViewer'}, @{N=60; T='Open Services console'; F='ServicesConsole'}, @{N=61; T='Open Computer Management'; F='ComputerManagement'}, @{N=62; T='Open Registry Editor'; F='RegistryEditor'}, @{N=63; T='Open Group Policy Editor'; F='GroupPolicyEditor'}, @{N=64; T='Open Local Users and Groups';F='LocalUsersGroups'}, @{N=65; T='Open System Configuration'; F='SystemConfiguration'}, @{N=66; T='Open DirectX Diagnostic Tool';F='DirectXDiag'}, @{N=67; T='Open Reliability Monitor'; F='ReliabilityMonitor'}, @{N=68; T='Current directory'; F='CurrentDirectory'}, @{N=69; T='Change directory'; F='ChangeDirectory'}, @{N=70; T='List directory'; F='ListDirectory'}, @{N=71; T='Tree view'; F='TreeView'}, @{N=72; T='Search files'; F='SearchFiles'}, @{N=73; T='Find text in files'; F='FindTextInFiles'}, @{N=74; T='Copy file/folder'; F='CopyFileTool'}, @{N=75; T='Move file/folder'; F='MoveFileTool'}, @{N=76; T='Delete file/folder'; F='DeleteFileTool'}, @{N=77; T='Create folder'; F='NewFolderTool'}, @{N=78; T='File SHA256 hash'; F='FileHashTool'}, @{N=79; T='Compress ZIP'; F='CompressZipTool'}, @{N=80; T='Extract ZIP'; F='ExtractZipTool'}, @{N=81; T='Clean temp files'; F='CleanTempFiles'}, @{N=82; T='Empty Recycle Bin'; F='EmptyRecycleBinTool'}, @{N=83; T='Find largest files'; F='LargeFilesFinder'}, @{N=84; T='Recent files'; F='RecentFiles'}, @{N=85; T='Open hosts file'; F='OpenHostsFile'}, @{N=86; T='Open startup folder'; F='OpenStartupFolder'}, @{N=87; T='Simple folder backup'; F='BackupFolderSimple'}, @{N=88; T='Disk usage by folder'; F='DiskUsageByFolder'}, @{N=89; T='Open Settings'; F='OpenSettings'}, @{N=90; T='Open Display settings'; F='OpenDisplaySettings'}, @{N=91; T='Open Sound settings'; F='OpenSoundSettings'}, @{N=92; T='Open Network settings'; F='OpenNetworkSettings'}, @{N=93; T='Open Apps settings'; F='OpenAppsSettings'}, @{N=94; T='Open Startup settings'; F='OpenStartupSettings'}, @{N=95; T='Open Windows Update'; F='OpenWindowsUpdate'}, @{N=96; T='Toggle dark/light mode'; F='DarkModeToggle'}, @{N=97; T='Toggle hidden files'; F='ShowHiddenFilesToggle'}, @{N=98; T='Toggle file extensions'; F='ShowFileExtensionsToggle'}, @{N=99; T='Restart Explorer'; F='RestartExplorer'}, @{N=100;T='Run SFC scan'; F='SFCScan'} ) $AdvancedFeatures = @( @{N=101;T='Open Privacy settings'; F='OpenPrivacySettings'}, @{N=102;T='Open Power settings'; F='OpenPowerSettings'}, @{N=103;T='Open Bluetooth settings'; F='OpenBluetoothSettings'}, @{N=104;T='Change computer name'; F='ChangeComputerName'}, @{N=105;T='List time zones'; F='List-TimeZonesTool'}, @{N=106;T='Set time zone'; F='Set-TimeZoneTool'}, @{N=107;T='List power plans'; F='PowerPlanList'}, @{N=108;T='Set high performance power plan';F='SetHighPerformance'}, @{N=109;T='Battery report'; F='BatteryReport'}, @{N=110;T='Energy report'; F='EnergyReport'}, @{N=111;T='Open screenshots folder'; F='ScreenshotFolder'}, @{N=112;T='Set wallpaper'; F='WallpaperSet'}, @{N=113;T='Lock computer'; F='LockComputer'}, @{N=114;T='Get clipboard text'; F='ClipboardText'}, @{N=115;T='Set clipboard text'; F='SetClipboardText'}, @{N=116;T='DISM restore health'; F='DISMHealth'}, @{N=117;T='Check disk scan'; F='CheckDisk'}, @{N=118;T='Windows Memory Diagnostic'; F='WindowsMemoryDiagnostic'}, @{N=119;T='Defender quick scan'; F='DefenderQuickScan'}, @{N=120;T='Defender full scan'; F='DefenderFullScan'}, @{N=121;T='Defender status'; F='DefenderStatus'}, @{N=122;T='Update Defender signatures'; F='UpdateDefender'}, @{N=123;T='Windows update history'; F='WindowsUpdateHistory'}, @{N=124;T='Generate Wi-Fi report'; F='GenerateWiFiReport'}, @{N=125;T='Sleep study'; F='SleepStudy'}, @{N=126;T='Boot config'; F='BootConfig'}, @{N=127;T='Create restore point'; F='SystemRestorePoint'}, @{N=128;T='List restore points'; F='ListRestorePoints'}, @{N=129;T='Export System event log'; F='ExportEventLogs'}, @{N=130;T='List Appx packages'; F='AppxPackages'}, @{N=131;T='Winget list'; F='WingetList'}, @{N=132;T='Winget upgrade all'; F='WingetUpgradeAll'}, @{N=133;T='Open Safe Mode options'; F='OpenSafeModeOptions'}, @{N=134;T='Reboot'; F='RebootTool'}, @{N=135;T='Shutdown'; F='ShutdownTool'}, @{N=136;T='Sign out'; F='SignOutTool'}, @{N=137;T='Open Command Prompt'; F='OpenCommandPrompt'}, @{N=138;T='Open elevated PowerShell'; F='OpenPowerShellAdmin'}, @{N=139;T='Open Windows Terminal'; F='OpenTerminal'}, @{N=140;T='Disk health'; F='Show-DiskHealth'}, @{N=141;T='Open ports with process names'; F='Show-OpenPortsNamed'}, @{N=142;T='Failed logins (last 7 days)'; F='Show-FailedLogins'}, @{N=143;T='File/folder permissions'; F='Show-FilePermissions'}, @{N=144;T='Duplicate file finder'; F='Find-DuplicateFiles'}, @{N=145;T='Bulk rename files'; F='Bulk-RenameFiles'}, @{N=146;T='Export feature result to file'; F='Export-LastResult'} ) $Script:AllFeatures = $Features + $AdvancedFeatures function Show-MainMenu { Header $sectionColors = @{ 'System' = 'White' 'Networking' = 'Green' 'Processes' = 'Yellow' 'Files' = 'Cyan' 'Settings' = 'Magenta' } foreach ($item in $Features) { $n = $item['N'] $color = if ($n -le 21) { 'White' } elseif ($n -le 45) { 'Green' } elseif ($n -le 67) { 'Yellow' } elseif ($n -le 88) { 'Cyan' } else { 'Magenta' } Write-Host ("{0,3}. {1}" -f $n, $item['T']) -ForegroundColor $color } Write-Host "" Write-Host " Colours: " -NoNewline Write-Host "System " -ForegroundColor White -NoNewline Write-Host "| " -NoNewline Write-Host "Networking " -ForegroundColor Green -NoNewline Write-Host "| " -NoNewline Write-Host "Processes " -ForegroundColor Yellow -NoNewline Write-Host "| " -NoNewline Write-Host "Files " -ForegroundColor Cyan -NoNewline Write-Host "| " -NoNewline Write-Host "Settings" -ForegroundColor Magenta Write-Host "" Write-Host "Commands: A=advanced S=search F=favorites H=history L=log Q=quit" -ForegroundColor DarkGray } function Show-AdvancedMenu { Header Write-Host "-- Advanced Tools ------------------------------------------" -ForegroundColor DarkCyan foreach ($item in $AdvancedFeatures) { Write-Host ("{0,3}. {1}" -f $item['N'], $item['T']) } Write-Host "" Write-Host "B=back S=search H=history" -ForegroundColor DarkGray } function Search-Feature { param([switch]$AndRun) $q = Read-Host "Search features" $results = @() foreach ($item in $Script:AllFeatures) { if ($item['T'] -like "*$q*") { $results += [pscustomobject]@{ N = $item['N']; T = $item['T'] } } } if ($results.Count -eq 0) { Write-Host "No features found matching '$q'." -ForegroundColor Yellow return } $results | Format-Table N, T -AutoSize $pick = Read-Host "Enter number to run (blank to skip)" if ($pick -match '^\d+$') { $target = $Script:AllFeatures | Where-Object { $_['N'] -eq [int]$pick } if ($null -ne $target) { Invoke-Feature $target } else { Write-Host "Not found in results." -ForegroundColor Yellow } } } function Show-History { if ($Script:History.Count -eq 0) { Write-Host "No features run this session." -ForegroundColor Yellow return } Write-Host "Session history:" -ForegroundColor Cyan $Script:History | ForEach-Object { $f = $Script:AllFeatures | Where-Object { $_['N'] -eq $_ } if ($f) { Write-Host (" {0,3}. {1}" -f $f['N'], $f['T']) } } Write-Host "" $pick = Read-Host "Enter number to re-run (blank to skip)" if ($pick -match '^\d+$') { $target = $Script:AllFeatures | Where-Object { $_['N'] -eq [int]$pick } if ($null -ne $target) { Invoke-Feature $target } else { Write-Host "Not found." -ForegroundColor Yellow } } } function Show-Favorites { $favNums = Load-Favorites Write-Host "-- Favorites -----------------------------------------------" -ForegroundColor DarkYellow if ($favNums.Count -eq 0) { Write-Host " (none saved)" -ForegroundColor DarkGray } else { foreach ($n in $favNums) { $f = $Script:AllFeatures | Where-Object { $_['N'] -eq $n } if ($f) { Write-Host (" {0,3}. {1}" -f $f['N'], $f['T']) -ForegroundColor Yellow } } } Write-Host "" Write-Host " R=run a favorite A=add D=delete B=back" -ForegroundColor DarkGray $cmd = Read-Host "Choice" switch -Regex ($cmd) { '^[Rr]$' { $pick = Read-Host "Feature number to run" if ($pick -match '^\d+$') { $target = $Script:AllFeatures | Where-Object { $_['N'] -eq [int]$pick } if ($null -ne $target) { Invoke-Feature $target } else { Write-Host "Not found." -ForegroundColor Yellow; Pause-Tool } } } '^[Aa]$' { $pick = Read-Host "Feature number to add" if ($pick -match '^\d+$') { $favNums = @(Load-Favorites) + [int]$pick Save-Favorites $favNums Write-Host "Added." -ForegroundColor Green Pause-Tool } } '^[Dd]$' { $pick = Read-Host "Feature number to remove" if ($pick -match '^\d+$') { $favNums = @(Load-Favorites) | Where-Object { $_ -ne [int]$pick } Save-Favorites $favNums Write-Host "Removed." -ForegroundColor Green Pause-Tool } } } } while ($true) { Show-MainMenu $choice = Read-Host "Choose" if ($choice -match '^[Qq]$') { break } if ($choice -match '^[Ll]$') { notepad $Script:LogFile; continue } if ($choice -match '^[Ss]$') { Search-Feature; continue } if ($choice -match '^[Hh]$') { Show-History; continue } if ($choice -match '^[Ff]$') { Show-Favorites; continue } if ($choice -match '^[Aa]$') { while ($true) { Show-AdvancedMenu $a = Read-Host "Advanced choice" if ($a -match '^[Bb]$') { break } if ($a -match '^[Ss]$') { Search-Feature; continue } if ($a -match '^[Hh]$') { Show-History; continue } if ($a -match '^\d+$') { $target = $Script:AllFeatures | Where-Object { $_['N'] -eq [int]$a } if ($null -ne $target) { Invoke-Feature $target } else { Write-Host "Unknown choice." -ForegroundColor Yellow; Pause-Tool } } } continue } if ($choice -match '^\d+$') { $target = $Script:AllFeatures | Where-Object { $_['N'] -eq [int]$choice } if ($null -ne $target) { Invoke-Feature $target } else { Write-Host "Unknown choice." -ForegroundColor Yellow; Pause-Tool } } } Write-Host "Goodbye." -ForegroundColor Cyan