This troubleshooting guide is designed to help IT Support Engineers quickly diagnose and resolve problems encountered while using the PowerShell IT Support Toolkit.
It is important to distinguish between troubleshooting the toolkit (e.g., a script fails to execute or a module fails to load) and troubleshooting the system (e.g., the network script runs perfectly, but reports that DNS is unreachable). This guide focuses entirely on the former—ensuring the toolkit itself operates reliably.
When a toolkit script fails, follow this general diagnostic workflow:
- Confirm the project files exist: Verify that the project was extracted correctly and that the script you are trying to run exists (e.g.,
Test-Path .\scripts\IT-Toolkit.ps1). - Confirm PowerShell environment: Verify you are running Windows PowerShell 5.1 or PowerShell 7+ by typing
$PSVersionTable. - Run the script directly: If a script fails from the main menu, try running the backend script directly from the console to isolate the error message.
- Review toolkit logs: Check
logs\toolkit.logfor any internal toolkit errors. - Check Administrator privileges: Certain operations (like restarting services or reading security logs) will fail with "Access Denied" if you are not elevated.
- Escalate with logs: If the issue persists, gather the exact error message and the toolkit log before reporting a bug.
If the main interactive menu orchestrator (IT-Toolkit.ps1) fails to launch:
- Symptom:
The term '.\scripts\IT-Toolkit.ps1' is not recognized... - Fix: You are in the wrong working directory. Ensure your console is situated at the root of the project directory before executing
.\scripts\IT-Toolkit.ps1.
- Symptom:
IT-Toolkit.ps1 cannot be loaded because running scripts is disabled on this system. - Fix: Restart the toolkit using process-level bypass instead of attempting to run it natively in a restricted console:
powershell.exe -ExecutionPolicy Bypass -File ".\scripts\IT-Toolkit.ps1"
The toolkit relies on essential internal shared modules.
- Symptom: Red error stating
The specified module '...\scripts\common\Common.psm1' was not loaded... - Check: The toolkit dynamically resolves these paths relative to the executing script. If the
common\directory was deleted or the scripts were moved outside of the intended directory structure, they will fail. - Fix: Restore the original project directory structure. The orchestrator must be in
scripts\and the modules must be inscripts\common\.
- Symptom:
The term 'Write-ToolkitLog' is not recognized as the name of a cmdlet... - Fix: The
Logger.psm1orCommon.psm1module failed to load. Ensure you have not modified these.psm1files and accidentally removed theExport-ModuleMemberdeclarations.
If the main menu in IT-Toolkit.ps1 is malfunctioning:
- Symptom: Selecting a menu option returns a path error or immediately drops back to the prompt.
- Fix: The orchestrator maps menu options to specific backend scripts (e.g., Option 2 maps to
scripts\system\Get-Processes.ps1). If that specific.ps1file was renamed or deleted, the child process will fail.
- Symptom: After executing a valid option, the script terminates instead of returning to the menu.
- Fix: Ensure
$ErrorActionPreference = 'Stop'hasn't caused an unhandled terminating error inside the orchestrator. Checklogs\toolkit.logfor details.
Child scripts are executed in an isolated PowerShell process by the orchestrator (via pwsh.exe or powershell.exe -File).
If a backend script (e.g., Get-DiskSpaceReport.ps1) fails when selected from the menu:
- Navigate to the project root.
- Execute the script directly:
.\scripts\storage\Get-DiskSpaceReport.ps1 - If it succeeds directly but fails in the menu, the issue lies in child-process execution parameters or
$LASTEXITCODEmapping inIT-Toolkit.ps1. - If it fails directly, the issue lies within the script itself. Look for the standard
[ErrorType] Error Messageformatted output provided by the globalcatchblock.
- Symptom:
Get-Processes.ps1crashes when hitting a protected system process. - Fix: The script should natively handle inaccessible process properties via
SilentlyContinueor internaltry/catchblocks. If it terminates, ensure you haven't manually modified the script to remove these resiliency mechanisms.
- Symptom:
Restart-ServiceSafely.ps1returns Access Denied. - Fix: Restarting Windows services requires the console to be elevated. Run PowerShell as Administrator.
- Read-only scripts: Scripts like
Get-IPConfiguration.ps1orGet-SystemInfo.ps1should run as a standard user. - Administrative scripts: Scripts that manipulate state (
Disable-User.ps1,Stop-Service.ps1) must be run in an elevated session. - Partial Failures: If an operation like
Backup-FolderData.ps1succeeds on some files but fails on others, it is usually due to locked files or standard permission constraints. This is expected system behavior, not a script bug.
The scripts\networking\ directory contains wrappers around native Windows tools.
- Ping / Tracert Failures: If
Test-Ping.ps1orTraceRoute.ps1fails, check if the failure is a network timeout (the system is offline) or a syntax failure (invalid hostname/IP). - Native Tool Exit Codes: The orchestrator monitors
$LASTEXITCODE. If a native tool likeping.exefails to find the host, it returns a non-zero exit code. The toolkit is designed to catch this and report a failure.
- Symptom:
Get-SystemErrors.ps1returns no data or fails with an access error. - Fix: Certain event logs (specifically
Security) restrict read access to Administrators. Run elevated. If you still receive no data, verify that the specified log name and Event IDs actually exist on the target machine.
The Clear-TempFiles.ps1 script performs potentially destructive actions.
- Symptom: Files are skipped or the script reports
Partialsuccess. - Fix: This is intended behavior. The script safely bypasses locked files currently in use by the OS or running applications using
-ErrorAction SilentlyContinue. Do not attempt to force-delete these files, as it can destabilize the system. - Symptom: Custom path deletion fails.
- Fix: Ensure the custom path is absolute and verified by
Test-Path. The script is designed to reject invalid or dangerous target paths to prevent accidental system deletion.
Many diagnostic scripts support an -ExportPath parameter.
- Symptom: The script runs successfully, but no JSON report is generated.
- Fix: Verify the target directory exists.
Export-ToolkitReportrequires a valid path. If you specify.\output\report.json, ensure theoutput\folder actually exists in the project root. - Symptom: Access Denied when exporting.
- Fix: You specified an export path in a protected directory (e.g.,
C:\Windows\System32\). Export to the project's nativeoutput\folder or a standard user directory like~\Documents\.
The toolkit automatically logs errors via Write-ToolkitLog from Logger.psm1.
- Log Location: By default, logs are written to
logs\toolkit.logrelative to the project root. - Log Failures: If the logger cannot write to
toolkit.log(due to permissions or file locks), it will safely fall back to printing a standardWrite-Warningto the console, ensuring the main script does not crash simply because logging failed.
If you modify a toolkit script and it immediately crashes upon execution:
- Symptom:
Unexpected token...orMissing closing '}'... - Fix: Before running, you can safely validate the script's syntax using the PowerShell parser:
If
$errors = $null [System.Management.Automation.Language.Parser]::ParseFile(".\scripts\system\Get-Processes.ps1", [ref]$null, [ref]$errors) $errors
$errorsis empty, the syntax is valid.
Before escalating a toolkit issue, verify the following:
- You are running Windows PowerShell 5.1 or PowerShell 7+.
- You are launching the toolkit from its root directory.
- The
scripts\andscripts\common\directories exist. - You have bypassed the execution policy for the current process if required.
- You are running as Administrator (if the task modifies system state).
- The backend script runs successfully on its own, outside of the menu.
- You have checked
logs\toolkit.logfor backend errors.
If you have isolated an issue that indicates a bug in the toolkit itself, please gather the following information before filing a report:
- Script Name: (e.g.,
IT-Toolkit.ps1orGet-Processes.ps1) - PowerShell Version: (Output of
$PSVersionTable.PSVersion) - Windows Version: (e.g., Windows 10 22H2)
- Execution Method: (Did it fail from the main menu, or direct execution?)
- Exact Command Used: (e.g.,
.\scripts\system\Get-Processes.ps1 -ExportPath .\test.json) - Exact Error Message: (Copy the exact text)
- Expected Behavior: (What should have happened)
- Actual Behavior: (What actually happened)
- Reproducibility: (Does it happen every time?)
SECURITY NOTE: When submitting logs or error output, ensure you remove any sensitive network information, internal IP addresses, or proprietary system names before sharing.