A PowerShell 7+ module for day-to-day IT automation: browser profile cleanup, remote software inventory, Purview eDiscovery workflows, EXO message trace, battery health parsing, AAD Connect remote sync, and more.
This is a new project to fold all (okay most) of my scripts into an enterprise-grade PowerShell module.
There are many more Public Commands available than listed here. Please use Get-ToolboxHelp for details on those listed here, as well as those not listed.
# This module is designed for PowerShell 7
# Import module from a local path
Import-Module .\TechToolbox -Force
# See exported commands
Get-Command -Module TechToolbox | Sort-Object Name
# View help for any command
Get-ToolboxHelp Clear-BrowserProfileData -DetailedThe module auto-loads functions from
Private/(helpers) andPublic/(exported), and caches configuration viaGet-TechToolboxConfig.
Create Config\config.json and tailor to your environment. Below is a minimal
example with commonly used sections. Omit any you do not need; defaults will
be applied where sensible. The full config.json is located here.
{
"paths": {
"temp": "C:\\Temp\\TechToolbox",
"logs": "C:\\LogsAndExports\\Logs\\TechToolbox",
"exportDirectory": "C:\\LogsAndExports\\Exports\\TechToolbox"
},
"settings": {
"defaults": {
"promptForHostname": true,
"promptForCredentials": true,
"promptForDateRanges": true,
"promptForCaseName": true,
"promptForSearchName": true,
"promptForKqlQuery": true
},
"logging": {
"enableConsole": true,
"enableFileLogging": false,
"includeTimestamps": true,
"logFileNameFormat": "TechToolbox_{yyyyMMdd}.log",
"minimumLevel": "Info"
},
"dnsLogging": {
"enabled": true,
"autoEnableDiagnostics": true,
"parseMode": "simple",
"maxLogSizeMB": 50,
"logPath": "C:\\LogsAndExports\\TechToolbox\\Logs\\DNS"
},
"copyDirectory": {
"runRemote": true,
"defaultComputerName": null,
"logDir": "C:\\LogsAndExports\\TechToolbox\\Logs\\Robocopy",
"retryCount": 2,
"waitSeconds": 5,
"copyFlags": ["/E", "/COPYALL"],
"mirror": false
},
"subnetScan": {
"pingTimeoutMs": 250,
"tcpTimeoutMs": 500,
"httpTimeoutMs": 1000,
"ewmaAlpha": 0.15,
"displayAlpha": 0.1,
"defaultPort": 80,
"exportCsv": true,
"resolveNames": true,
"httpBanner": true
}
}
}A standard help function.
Get-ToolboxHelp
# Show Effective Config switch
Get-ToolboxHelp -ShowEffectiveConfigDeletes cache, cookies, and (optionally) local storage for Chrome/Edge profiles. Supports -WhatIf/-Confirm.
# Preview cleanup for both browsers
Clear-BrowserProfileData -WhatIf
# Target Chrome only and just cache
Clear-BrowserProfileData -Browser Chrome -IncludeCache:$true -IncludeCookies:$false
# Target specific profiles, skip local storage
Clear-BrowserProfileData -Browser Edge -Profiles 'Default','Profile 2' -SkipLocalStorageCollects installed software from remote Windows hosts via PSRemoting (registry uninstall keys; optional Appx/MSIX). Exports per-host or consolidated CSV.
# Query two servers, consolidated CSV
Get-RemoteInstalledSoftware -ComputerName srv01,srv02 -Consolidated
# Include Appx packages, prompt for credentials
Get-RemoteInstalledSoftware -ComputerName laptop01 -IncludeAppx -Credential (Get-Credential)
# Preview without writing any files
Get-RemoteInstalledSoftware -ComputerName srv01,srv02 -WhatIfEnd-to-end Purview HardDelete workflow: connect, clone/create mailbox-only search, wait for completion, submit purge, optional disconnect.
# Normal run
Invoke-PurviewPurge -UserPrincipalName admin@company.com -CaseName "Case-001" -SearchName "CustodianSearch-01"
# Preview purge submission
Invoke-PurviewPurge -UserPrincipalName admin@company.com -CaseName "Case-001" -SearchName "CustodianSearch-01" -WhatIfRuns EXO V2 message trace by RFC822 Message-ID, shows summary and per-recipient details, and optionally exports CSVs.
# 24-hour lookback window (defaults from config)
Get-MessageTrace -MessageId '<abc123@company.com>'
# Custom date window
Get-MessageTrace -MessageId '<abc123@company.com>' -StartDate (Get-Date).AddHours(-12) -EndDate (Get-Date)
# Auto-export to default folder
Get-MessageTrace -MessageId '<abc123@company.com>' -WhatIfGenerates powercfg /batteryreport, parses the Installed batteries table from HTML, computes health metrics, and writes JSON.
# Use config defaults
Get-BatteryHealth
# Custom paths, preview only
Get-BatteryHealth -ReportPath 'C:\Temp\battery-report.html' -OutputJson 'C:\Temp\batteries.json' -WhatIfRemotely triggers Azure AD Connect (Start-ADSyncSyncCycle) using PSRemoting. Kerberos or credential-based.
# Delta sync using defaults
Invoke-AADSyncRemote -ComputerName 'aadconnect01'
# Initial sync via Kerberos, preview only
Invoke-AADSyncRemote -ComputerName 'aadconnect01' -PolicyType Initial -UseKerberos -WhatIf
# HTTPS WinRM (5986) with transcript in Logs
Invoke-AADSyncRemote -ComputerName 'aadconnect01.company.com' -Port 5986 -EnableTranscriptLoads the configs from config.json manually if needed
Get-TechToolboxConfigRemotely set initial and maximum sizes of the pagefile in MB.
# Usage of defaults (grabbed from config.json)
Set-PageFileSize -ComputerName "Server01.domain.local"
# Set via parameters during script call
Set-PageFileSize -ComputerName "Server01.domain.local" -InitialSize 4096 -MaximumSize 8192 -Path "C:\pagefile.sys"- Structure:
Private/(helpers),Public/(exported),Config/(json),TechToolbox.psm1(loader),TechToolbox.psd1(manifest). - One function per file with matching names for clean auto-export.
- Advanced Functions:
[CmdletBinding()], validated parameters,ShouldProcessfor state changes. - Logging: centralized
Write-Logusing streams (Write-Information,Write-Warning,Write-Error) and optional file logging via config. - Config cache:
Get-TechToolboxConfigreturns a cached object; addReset-TechToolboxConfigif you need runtime reloads. - Cross-platform: Target is Windows; Chromium paths, EXO/Purview cmdlets assume Windows/EXO contexts.
- Module import: Ensure
TechToolbox.psd1points toTechToolbox.psm1and PowerShell 7+. - Permissions:
- Remote inventory / AADSync require WinRM and appropriate rights on target hosts.
- Purview workflows require eDiscovery roles and ExchangeOnlineManagement module.
- Message trace: V2 retention limits apply; widen the window or verify Message-ID.
- Battery report:
powercfgmust be present; run PowerShell as admin if report generation fails. - Logging to file: Confirm
Paths.LogDirectoryexists orEnableFileLoggingis false.
# Analyzer (configurable rules)
Invoke-ScriptAnalyzer -Path .\TechToolbox -Recurse -Severity Error,Warning
# Smoke tests (dry runs)
Clear-BrowserProfileData -WhatIf
Get-RemoteInstalledSoftware -ComputerName srv01 -WhatIf
Invoke-PurviewPurge -UserPrincipalName you@company.com -CaseName Case-001 -SearchName Search-001 -WhatIf
Get-MessageTrace -MessageId '<test@company.com>' -WhatIf
Get-BatteryHealth -WhatIf
Invoke-AADSyncRemote -ComputerName aadconnect01 -PolicyType Delta -WhatIfAuthor: Dan Damit
License: Internal use
Version: 0.7.0