Skip to content

Commit 1fe3214

Browse files
authored
1.3.1 Merge (#101)
* Fix for #93 * Update ETT.ps1 * Update ETT.ps1 Remediation and cleanup for 1.3.1 fixes * Removing some sample function code * Updated Toast Notification Stack * Fixed ClearLastLogin Bug #96 * Added Windows Repair Tools * Added Windows Defender Functions * Added Delete Group Policy Cache Function * First pass in work on #97 * Added first pass of outlook rollback for #97 * #97 - Grammar Tweak Tweaked grammar for restoring old outlook function to use proper PS prefix * Additional cleanup and bug fixes Few tweaks, and finally solved our issues in #87 ! * Update SECURITY.md Prepped version rollover for security support in 1.3.1 * Update copyright year in LICENSE file * Update ToolboxFunctions.ps1 Added passthru elevation of #97 * Update ETT.ps1 Removed duplicate SFC toolbox option. Production location will now be under the "Windows" tab * Fixed some bugs in #97 As a part of general review in #98 , squashed some bugs regarding how the Outlook repair tool runs. * Update ToolboxFunctions.ps1 Modified and added error handling to the outlook legacy rollback * Add keyboard shortcut for Exit button using Escape key * Added "Prevent Automatic Update" for Outlook (Legacy) to New Outlook * Update LICENSE Signed-off-by: Eli Weitzman <22529819+eliweitzman@users.noreply.github.com> * Update copyright year in license header Changed the copyright year in the license header from 2024-2025 to 2025 to reflect the current year. * Initial plan * Implement configurable tab ordering for toolbox tabs Co-authored-by: eliweitzman <22529819+eliweitzman@users.noreply.github.com> * Finalize tab ordering implementation and reset config to default Co-authored-by: eliweitzman <22529819+eliweitzman@users.noreply.github.com> * Update tab functions to prepare for 1.3.1-Dev merge * Fix syntax error: remove extra closing brace * Refactor ETT.ps1 to replace deprecated WMI commands with CIM commands and improve code formatting * Revert "Update LICENSE" This reverts commit f6ae920. * Revert "Update copyright year in license header" This reverts commit 628e96c. * Rollback and remove tab order cusomization Due to buggy code, rolling back and removing tab reordering - will fix CIM compliance next * Replace Get-WmiObject with Get-CimInstance Updated ETT.ps1 and ToolboxFunctions.ps1 to use Get-CimInstance instead of the deprecated Get-WmiObject for querying system information. This improves compatibility and performance with newer versions of PowerShell. * Fix adminmode checks to use boolean comparison Replaced string comparison ($adminmode -eq "True") with boolean comparison ($adminmode -eq $true) in multiple functions to ensure proper admin mode detection and improve code reliability. * Update PSAssets/ToolboxFunctions.ps1 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Eli Weitzman <22529819+eliweitzman@users.noreply.github.com> * Add Copilot instructions for PowerShell app Introduces .github/copilot-instructions.md with guidance for AI agents and developers working on the Windows PowerShell application. Covers project structure, workflows, conventions, integration points, editing examples, compilation steps, and troubleshooting tips. * Improve settings menu error handling and update copyright Added more specific error messages and user guidance in SettingsMenu.ps1 for cases where the settings menu is disabled or not referenced in the config, including an option to open the GitHub repository for the latest config. In ETT.ps1, updated the copyright year and improved robustness of Toolbox tab creation. * Updated license, as well as latest windows version in the Config template * Rename Delete-GroupPolicyCache function to Clear-GroupPolicyCache for consistency and avoid restricted word. * Update ToolboxFunctions.ps1 * Remove FUNDING.yml and add toolbox-item skill Delete obsolete .github/FUNDING.yml and add a new skill guide at .github/skills/toolbox-item-creator/SKILL.md. The new SKILL.md provides a guided prompt for creating toolbox actions (custom_ functions or Create-ToolboxListItem), including inputs to collect, implementation steps, admin gating, ETTConfig.json consistency checks, and completion criteria. ---------
1 parent 38eca94 commit 1fe3214

9 files changed

Lines changed: 402 additions & 93 deletions

File tree

.github/FUNDING.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/SECURITY.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ This Security Policy provides guidelines and procedures for maintaining the conf
66

77
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.
88

9-
| Version | Supported |
10-
| ------- | ------------------ |
11-
| 1.0/1.1 | :stop_sign: - End of Support|
12-
| 1.2.1 | :warning: - EOL with 1.3 rollout, autoupdate is supported |
13-
| 1.3 | :white_check_mark: |
9+
| Version | Supported |
10+
| ----------------| ------------------ |
11+
| 1.0, 1.1, 1.2 | :stop_sign: - End of Support|
12+
| 1.3 | :warning: - EOL with 1.3.1 rollout, autoupdate is supported |
13+
| 1.3.1 | :white_check_mark: |
1414

1515
## ETT-Admin Version Support
1616

.github/copilot-instructions.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## Enterprise Tech Tool — Copilot / AI Agent Guidance
2+
3+
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.
4+
5+
### Big picture
6+
- 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`).
7+
- UI and features are defined by functions in `PSAssets/*.ps1` and `MiniClients/*.ps1` and then composed inside `ETT.ps1` (toolbox, tabs, and buttons).
8+
- Packaging: authors use PS2EXE (see `Compiler/ps2exe.ps1`) to compile a portable EXE; runtime behavior differs when compiled vs running the raw PS1.
9+
10+
### Developer / runtime workflows (explicit)
11+
- 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.
12+
- 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.
13+
- Auto-update and releases: `ETT.ps1` checks GitHub tags (API) for release tags; offline devices will skip update checks.
14+
15+
### Project-specific conventions and patterns
16+
- 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_*`).
17+
- 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).
18+
- GUI construction uses a small set of composable helpers. Common helpers to reuse/patch:
19+
- `Create-ETTButton` (ETT.ps1) — returns a WinForms Button wired to a ScriptBlock.
20+
- `Create-ToolboxListItem` — returns PSCustomObject used in toolbox lists.
21+
- `Create-ToolboxTabPage` — builds tabs and listboxes for toolbox items.
22+
- `Create-GenericToolWindow` (PSAssets/GenericToolWindow.ps1) — standard pattern for AD/BitLocker windows.
23+
- 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.
24+
25+
### Integration points / external dependencies to be aware of
26+
- 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.
27+
- Microsoft Graph (Get-MGContext / Connect-MgGraph) — used by Entra ID / BitLocker key retrieval in `MiniClients`.
28+
- winget (Windows Package Manager) — used for app updates and referenced in README for install flow.
29+
- Vendor CLIs (Dell/Lenovo command-line updaters) — code contains explicit checks for vendor-specific paths when invoking driver update logic.
30+
31+
### Concrete editing examples (copy / paste friendly)
32+
- Add a new toolbox action (place near other toolbox arrays in `ETT.ps1`):
33+
34+
`# Example: add a quick diagnostic action`
35+
`[void]$ActionsTabArray.Add((Create-ToolboxListItem -DisplayName "Quick Disk Health" -RequireAdmin $true -ScriptBlock { Start-Process powershell.exe -Verb RunAs -ArgumentList '-Command', 'chkdsk C:' }))`
36+
37+
- Add a simple custom function (script scope) and let UI pick it up:
38+
39+
`function custom_ShowHello { $wshell = New-Object -ComObject Wscript.Shell; $wshell.Popup('Hello from custom_ShowHello',0,'ETT',64) }`
40+
41+
- Add a config-driven custom function to `ETTConfig.json` (example entry):
42+
43+
`{ "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)" }
44+
45+
### Observed gotchas / edge cases (experimentally verified)
46+
- 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.
47+
- Platform: Windows-only. Tests or automation must run on Windows with PowerShell and required modules installed.
48+
- Admin flows: UI shows a shield emoji for tools that require admin; ensure scripts that perform registry or BitLocker changes always verify `$adminmode`.
49+
- 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.
50+
51+
### Files and locations you will reference most
52+
- `ETT.ps1` — main app orchestration (load order, flags, `$Dependencies`).
53+
- `ETTConfig.json` — runtime customization (brand color, AutoUpdateCheckerEnabled, CustomFunctions, Azure IDs).
54+
- `PSAssets/ToolboxFunctions.ps1` — primary toolbox helper functions and many action implementations.
55+
- `PSAssets/GenericToolWindow.ps1` — reusable GUI window builder (used by BitLocker and AD tools).
56+
- `MiniClients/*.ps1` — small utilities (ADLookup, BitLocker, LAPS, etc.) used by toolbox tabs.
57+
- `Compiler/ps2exe.ps1` — compile helper and intended packaging flow.
58+
59+
### How to compile (PS2EXE) — quick recipe
60+
61+
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.
62+
63+
1) Install PS2EXE (optional if you already have `Compiler/ps2exe.ps1`):
64+
65+
```powershell
66+
# Install the community PS2EXE module (if needed)
67+
Install-Module -Name ps2exe -Scope CurrentUser -Force
68+
```
69+
70+
2) Basic compile (recommended starting command):
71+
72+
```powershell
73+
# From the repository root
74+
# Uses the community ps2exe wrapper if installed; otherwise run the repo's Compiler/ps2exe.ps1 script similarly
75+
Invoke-ps2exe -inputFile .\ETT.ps1 -outputFile .\dist\ETT.exe -iconFile .\ImageAssets\EnterpriseTechTool.ico -noConsole -x64
76+
```
77+
78+
If you prefer to call the included script directly (it may wrap options differently):
79+
80+
```powershell
81+
& '.\Compiler\ps2exe.ps1' -InputFile '.\ETT.ps1' -OutputFile '.\dist\ETT.exe' -x64
82+
```
83+
84+
Notes and recommended options
85+
- Use `-x64` for 64-bit builds (recommended). The GUI and some MiniClients note "MUST COMPILE WITH x64".
86+
- `-noConsole` removes the console window and produces a GUI-only EXE.
87+
- Provide an `-iconFile` to brand the EXE; put an .ico in `ImageAssets/` and reference it.
88+
89+
Dot-sourcing and embedding caveat
90+
- `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:
91+
- Verify that the compiled EXE behaves as expected and that all UI modules are available.
92+
- 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).
93+
94+
Quick verification checklist after building
95+
- Run the compiled EXE on a Windows test machine.
96+
- Confirm the app window appears and basic buttons (Clear Last Login, Get LAPS Password) open their windows.
97+
- Test one admin and one non-admin flow (e.g., Start-WingetAppUpdates and Get-WindowsActivationKey) to confirm elevation behavior and UAC prompts.
98+
- Check BitLocker and AD windows on a machine with RSAT / Microsoft Graph available to ensure those paths work.
99+
100+
If anything fails, the two fastest remedies are:
101+
- Re-run as a script (`.\ETT.ps1`) to get full error output (dot-sourcing provides easier debugging).
102+
- Temporarily add verbose/logging output around the `$Dependencies` dot-source loop to confirm whether each helper file is loaded inside the EXE.
103+
104+
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.
105+
106+
---
107+
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).
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: toolbox-item-creator
3+
description: 'Guided prompt to generate a custom_ function or a Create-ToolboxListItem block for EnterpriseTechTool. Use when adding toolbox actions with admin gating, tooltip, and a matching entry in ETTConfig.json.'
4+
argument-hint: 'Provide the tool name, description, tab, requires admin (yes/no), and the action script block.'
5+
user-invocable: true
6+
---
7+
8+
# Toolbox Item Creator
9+
10+
Create a new toolbox action for EnterpriseTechTool either as a `custom_` function or a `Create-ToolboxListItem` block, with admin gating, a tooltip, and a matching entry in `ETTConfig.json`.
11+
12+
## When to Use
13+
- Adding a new toolbox button or list item
14+
- Creating a `custom_` function for auto-discovery
15+
- Keeping `ETTConfig.json` in sync with UI actions
16+
17+
## Inputs to Collect
18+
- Display name
19+
- Short description (tooltip)
20+
- Tab name (existing or new)
21+
- Requires admin (yes/no)
22+
- Action logic (script block)
23+
- Preferred approach: `custom_` function or `Create-ToolboxListItem`
24+
25+
## Procedure
26+
1. **Clarify the approach**
27+
- If the action should be auto-discovered, choose a `custom_` function.
28+
- If it belongs in a specific toolbox list, use `Create-ToolboxListItem`.
29+
30+
2. **Draft the PowerShell implementation**
31+
- For a `custom_` function, name it with the `custom_` prefix.
32+
- For `Create-ToolboxListItem`, create the list item and add it to the correct tab array.
33+
- Add admin gating with `$adminmode` or elevation via `Start-Process -Verb RunAs`.
34+
35+
3. **Add a matching `ETTConfig.json` entry**
36+
- Create or update a `CustomFunctions` entry with:
37+
- `displayName`, `description`, `tab`, `requireAdmin`, `codeBlock`
38+
- Ensure the `codeBlock` matches the intended action logic.
39+
40+
4. **Add or verify tooltip text**
41+
- Ensure the description is concise and user-facing.
42+
43+
5. **Validate consistency**
44+
- Names match between UI label and `ETTConfig.json`.
45+
- Admin requirement is consistent across UI and config.
46+
- Script block is safe to run in non-admin mode when `requireAdmin` is false.
47+
48+
## Completion Checks
49+
- The new action appears in the intended tab or auto-discovery list.
50+
- Admin-only actions show the shield indicator and elevate correctly.
51+
- `ETTConfig.json` contains the matching entry with required fields.

0 commit comments

Comments
 (0)