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:
@@ -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 = @()
|
||||
|
||||
Reference in New Issue
Block a user