1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 18:40:05 +00:00

fix(windows): fix property access errors and scanning performance

- Fix analyze: Add timeout and depth limits to calculateDirSize() to prevent
  indefinite scanning on large directories like user profile
- Fix purge: Add null checks for .Count property access under StrictMode
- Fix uninstall: Wrap registry property access in try/catch for items without
  DisplayName, and add null checks throughout
- Fix mole.ps1: Add null check for Arguments.Count
- Add try/catch around CursorVisible calls for non-interactive terminals

All 73 Pester tests and all Go tests pass.
This commit is contained in:
Bhadra
2026-01-08 19:33:26 +05:30
parent 3ebaeefa18
commit 3653900e2d
4 changed files with 180 additions and 70 deletions

View File

@@ -163,7 +163,8 @@ function Invoke-MoleCommand {
# Execute the command script with arguments using splatting
# This properly handles switch parameters passed as strings
if ($Arguments -and $Arguments.Count -gt 0) {
$argCount = if ($null -eq $Arguments) { 0 } else { @($Arguments).Count }
if ($argCount -gt 0) {
# Build a hashtable for splatting
$splatParams = @{}
$positionalArgs = @()