Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e134bfe
Fix for #93
eliweitzman Aug 3, 2024
5b39223
Update ETT.ps1
eliweitzman Sep 8, 2024
cb38b5b
Update ETT.ps1
eliweitzman Sep 8, 2024
4a5cc4f
Removing some sample function code
eliweitzman Sep 8, 2024
b799f7c
Updated Toast Notification Stack
TheDeadGPU Sep 8, 2024
55f9d03
Fixed ClearLastLogin Bug #96
TheDeadGPU Sep 8, 2024
f63f457
Added Windows Repair Tools
TheDeadGPU Sep 30, 2024
d43efd7
Added Windows Defender Functions
TheDeadGPU Sep 30, 2024
efff9fc
Added Delete Group Policy Cache Function
TheDeadGPU Oct 2, 2024
783225d
First pass in work on #97
eliweitzman Oct 26, 2024
f7f22ed
Added first pass of outlook rollback for #97
eliweitzman Oct 28, 2024
01e0ee4
#97 - Grammar Tweak
eliweitzman Nov 23, 2024
04c2bb3
Additional cleanup and bug fixes
eliweitzman Nov 23, 2024
f295aaf
Update SECURITY.md
eliweitzman Nov 24, 2024
b3f539d
Update copyright year in LICENSE file
eliweitzman Nov 24, 2024
2efb6a1
Update ToolboxFunctions.ps1
eliweitzman Nov 28, 2024
281c8e8
Update ETT.ps1
eliweitzman Nov 28, 2024
7c8b195
Fixed some bugs in #97
eliweitzman Nov 28, 2024
68f97e7
Update ToolboxFunctions.ps1
eliweitzman Nov 29, 2024
78cbc9b
Add keyboard shortcut for Exit button using Escape key
eliweitzman Dec 7, 2024
bd2bd7c
Added "Prevent Automatic Update" for Outlook (Legacy) to New Outlook
eliweitzman Dec 24, 2024
f6ae920
Update LICENSE
eliweitzman Apr 21, 2025
628e96c
Update copyright year in license header
eliweitzman Jul 4, 2025
ffc87d5
Initial plan
Copilot Jul 4, 2025
f596a82
Implement configurable tab ordering for toolbox tabs
Copilot Jul 4, 2025
c2fbcb4
Finalize tab ordering implementation and reset config to default
Copilot Jul 4, 2025
8281e17
Update tab functions to prepare for 1.3.1-Dev merge
Copilot Jul 4, 2025
58db80c
Merge branch '1.3.1-Dev' into copilot/fix-75
Copilot Jul 4, 2025
6c9181c
Fix syntax error: remove extra closing brace
Copilot Jul 4, 2025
298fadb
Merge pull request #100 from eliweitzman/copilot/fix-75
eliweitzman Jul 4, 2025
566a96f
Refactor ETT.ps1 to replace deprecated WMI commands with CIM commands…
eliweitzman Aug 30, 2025
c0c7c66
Revert "Update LICENSE"
eliweitzman Sep 7, 2025
244e0f9
Revert "Update copyright year in license header"
eliweitzman Sep 7, 2025
639e0e6
Rollback and remove tab order cusomization
eliweitzman Sep 7, 2025
6d3efad
Replace Get-WmiObject with Get-CimInstance
eliweitzman Sep 7, 2025
3ae05e5
Fix adminmode checks to use boolean comparison
eliweitzman Sep 7, 2025
69c16c7
Update PSAssets/ToolboxFunctions.ps1
eliweitzman Sep 7, 2025
57c3336
Add Copilot instructions for PowerShell app
eliweitzman Oct 24, 2025
700cc43
Improve settings menu error handling and update copyright
eliweitzman Dec 31, 2025
6d4d038
Updated license, as well as latest windows version in the Config temp…
eliweitzman Jan 11, 2026
20fe9e4
Rename Delete-GroupPolicyCache function to Clear-GroupPolicyCache for…
eliweitzman Apr 4, 2026
dd5d1f1
Update ToolboxFunctions.ps1
eliweitzman Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ This Security Policy provides guidelines and procedures for maintaining the conf

Due to the nature of the application being effectively just a PowerShell script, releases are only supported in active development. Should a security issue arise on your current version, patches only roll on newer updates, and there is no backwards support cycle currently in place. Users are expected to use the most recent version of the application for the best security and feature set. As of version 1.2.1, a built-in update path is now officially supported using the Windows Package Manager.

| Version | Supported |
| ------- | ------------------ |
| 1.0/1.1 | :stop_sign: - End of Support|
| 1.2.1 | :warning: - EOL with 1.3 rollout, autoupdate is supported |
| 1.3 | :white_check_mark: |
| Version | Supported |
| ----------------| ------------------ |
| 1.0, 1.1, 1.2 | :stop_sign: - End of Support|
| 1.3 | :warning: - EOL with 1.3.1 rollout, autoupdate is supported |
| 1.3.1 | :white_check_mark: |

## ETT-Admin Version Support

Expand Down
107 changes: 107 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
## Enterprise Tech Tool — Copilot / AI Agent Guidance

This repository is a single Windows PowerShell application with a small set of supporting modules and GUI helpers. The notes below capture the essential patterns, workflows, and examples an AI coding agent should know to be productive.

### Big picture
- Primary entrypoint: `ETT.ps1` — loads `ETTConfig.json`, sets runtime flags, and dot-sources the helper scripts listed in `$Dependencies` (see the `$Dependencies` array in `ETT.ps1`).
- UI and features are defined by functions in `PSAssets/*.ps1` and `MiniClients/*.ps1` and then composed inside `ETT.ps1` (toolbox, tabs, and buttons).
- Packaging: authors use PS2EXE (see `Compiler/ps2exe.ps1`) to compile a portable EXE; runtime behavior differs when compiled vs running the raw PS1.

### Developer / runtime workflows (explicit)
- Dev run (recommended for iterative edits): open PowerShell and dot-source `.\ETT.ps1` (or run it). Note: dot-sourcing in a compiled build behaves differently; many UI helpers and dot-sourced modules are intended for script execution.
- Build / compile: `Compiler/ps2exe.ps1` (project uses PS2EXE). Ensure PS2EXE is available in the environment. The README also documents winget packaging and the `EliWeitzman.ETT` package id.
- Auto-update and releases: `ETT.ps1` checks GitHub tags (API) for release tags; offline devices will skip update checks.

### Project-specific conventions and patterns
- Custom functions intended for the GUI toolbox must be named with the `custom_` prefix to be auto-discovered (ETT loads functions and `Get-Command` filters for `custom_*`).
- Custom tools can also come from `ETTConfig.json` under `CustomFunctions`; each entry expects: `displayName`, `description`, `tab`, `requireAdmin`, and `codeBlock` (string containing the code to run).
- GUI construction uses a small set of composable helpers. Common helpers to reuse/patch:
- `Create-ETTButton` (ETT.ps1) — returns a WinForms Button wired to a ScriptBlock.
- `Create-ToolboxListItem` — returns PSCustomObject used in toolbox lists.
- `Create-ToolboxTabPage` — builds tabs and listboxes for toolbox items.
- `Create-GenericToolWindow` (PSAssets/GenericToolWindow.ps1) — standard pattern for AD/BitLocker windows.
- Admin-aware flow: many actions check `$adminmode` and either run logic inline or call `Start-Process -Verb RunAs` to elevate. Assume privileged actions must be guarded and tested on Windows with UAC prompts.

### Integration points / external dependencies to be aware of
- RSAT / ActiveDirectory PowerShell module: many AD functions check `Get-Command -Name Get-ADComputer` and will disable GUI features if absent. Tests or CI must run on Windows with RSAT to exercise AD flows.
- Microsoft Graph (Get-MGContext / Connect-MgGraph) — used by Entra ID / BitLocker key retrieval in `MiniClients`.
- winget (Windows Package Manager) — used for app updates and referenced in README for install flow.
- Vendor CLIs (Dell/Lenovo command-line updaters) — code contains explicit checks for vendor-specific paths when invoking driver update logic.

### Concrete editing examples (copy / paste friendly)
- Add a new toolbox action (place near other toolbox arrays in `ETT.ps1`):

`# Example: add a quick diagnostic action`
`[void]$ActionsTabArray.Add((Create-ToolboxListItem -DisplayName "Quick Disk Health" -RequireAdmin $true -ScriptBlock { Start-Process powershell.exe -Verb RunAs -ArgumentList '-Command', 'chkdsk C:' }))`

- Add a simple custom function (script scope) and let UI pick it up:

`function custom_ShowHello { $wshell = New-Object -ComObject Wscript.Shell; $wshell.Popup('Hello from custom_ShowHello',0,'ETT',64) }`

- Add a config-driven custom function to `ETTConfig.json` (example entry):

`{ "displayName": "Show Random", "description": "Show random number", "tab":"Custom", "requireAdmin": false, "codeBlock": "$rand=(Get-Random -Minimum 1 -Maximum 100); $wshell=New-Object -ComObject Wscript.Shell; $wshell.Popup($rand,0,'Random',64)" }

### Observed gotchas / edge cases (experimentally verified)
- Dot-sourcing vs compiled EXE: dot-sourcing helper scripts (`. $psFile`) works for development but compiled EXE builds will often hit the `catch` and skip dot-sourced loads — verify behavior after compilation.
- Platform: Windows-only. Tests or automation must run on Windows with PowerShell and required modules installed.
- Admin flows: UI shows a shield emoji for tools that require admin; ensure scripts that perform registry or BitLocker changes always verify `$adminmode`.
- Winget and GitHub API calls can fail on offline devices — code already catches and degrades, but changes to update logic should keep that in mind.

### Files and locations you will reference most
- `ETT.ps1` — main app orchestration (load order, flags, `$Dependencies`).
- `ETTConfig.json` — runtime customization (brand color, AutoUpdateCheckerEnabled, CustomFunctions, Azure IDs).
- `PSAssets/ToolboxFunctions.ps1` — primary toolbox helper functions and many action implementations.
- `PSAssets/GenericToolWindow.ps1` — reusable GUI window builder (used by BitLocker and AD tools).
- `MiniClients/*.ps1` — small utilities (ADLookup, BitLocker, LAPS, etc.) used by toolbox tabs.
- `Compiler/ps2exe.ps1` — compile helper and intended packaging flow.

### How to compile (PS2EXE) — quick recipe

Summary: this project is typically distributed as a compiled EXE (PS2EXE). Development is easiest by dot-sourcing `ETT.ps1`. Use PS2EXE to build an EXE for portable or installer-based distribution.

1) Install PS2EXE (optional if you already have `Compiler/ps2exe.ps1`):

```powershell
# Install the community PS2EXE module (if needed)
Install-Module -Name ps2exe -Scope CurrentUser -Force
```

2) Basic compile (recommended starting command):

```powershell
# From the repository root
# Uses the community ps2exe wrapper if installed; otherwise run the repo's Compiler/ps2exe.ps1 script similarly
Invoke-ps2exe -inputFile .\ETT.ps1 -outputFile .\dist\ETT.exe -iconFile .\ImageAssets\EnterpriseTechTool.ico -noConsole -x64
```

If you prefer to call the included script directly (it may wrap options differently):

```powershell
& '.\Compiler\ps2exe.ps1' -InputFile '.\ETT.ps1' -OutputFile '.\dist\ETT.exe' -x64
```

Notes and recommended options
- Use `-x64` for 64-bit builds (recommended). The GUI and some MiniClients note "MUST COMPILE WITH x64".
- `-noConsole` removes the console window and produces a GUI-only EXE.
- Provide an `-iconFile` to brand the EXE; put an .ico in `ImageAssets/` and reference it.

Dot-sourcing and embedding caveat
- `ETT.ps1` dot-sources `MiniClients/*.ps1` and `PSAssets/*.ps1` at runtime via `$Dependencies`. During compilation these dot-sources are wrapped in a try/catch (the code intentionally swallows errors for compiled mode). After compiling:
- Verify that the compiled EXE behaves as expected and that all UI modules are available.
- If a helper script is not embedding or running, either: embed its contents into `ETT.ps1` before compiling, or adjust the compile wrapper to include additional files (some ps2exe versions support an `-include` parameter).

Quick verification checklist after building
- Run the compiled EXE on a Windows test machine.
- Confirm the app window appears and basic buttons (Clear Last Login, Get LAPS Password) open their windows.
- Test one admin and one non-admin flow (e.g., Start-WingetAppUpdates and Get-WindowsActivationKey) to confirm elevation behavior and UAC prompts.
- Check BitLocker and AD windows on a machine with RSAT / Microsoft Graph available to ensure those paths work.

If anything fails, the two fastest remedies are:
- Re-run as a script (`.\ETT.ps1`) to get full error output (dot-sourcing provides easier debugging).
- Temporarily add verbose/logging output around the `$Dependencies` dot-source loop to confirm whether each helper file is loaded inside the EXE.

If any of these sections are unclear or you'd like the file to be extended with examples for a specific task (e.g., add a new toolbox item, wire a new CustomFunction from JSON, or create a test harness), tell me which area to expand and I will iterate.

---
Please review these notes and tell me if you want additional examples (unit/test harness, or a short script to run local smoke-tests for common flows like: load UI, call a non-admin action, and call an admin action with elevation).
Loading