Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
60 changes: 19 additions & 41 deletions CONTRIBUTORS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions bin/analyze.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
param(
[Parameter(Position = 0)]
[string]$Path,

[Alias('h')]
[switch]$ShowHelp
)

Expand All @@ -19,13 +21,13 @@ $binPath = Join-Path $windowsDir "bin\analyze.exe"
function Show-AnalyzeHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Analyze$esc[0m - Interactive disk space analyzer"
Write-Host "$esc[1;35mmo analyze$esc[0m - Interactive disk space analyzer"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole analyze [path]"
Write-Host "$esc[33mUsage:$esc[0m mo analyze [path]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " [path] Path to analyze (default: user profile)"
Write-Host " -ShowHelp Show this help message"
Write-Host " [path] Path to analyze (default: user profile)"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mKeybindings:$esc[0m"
Write-Host " Up/Down Navigate entries"
Expand Down
44 changes: 29 additions & 15 deletions bin/clean.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
param(
[Alias('dry-run')]
[switch]$DryRun,

[Alias('s')]
[switch]$System,

[Alias('game-media')]
[switch]$GameMedia,

[Alias('d')]
[switch]$DebugMode,

[Alias('w')]
[switch]$Whitelist,

[Alias('h')]

[Alias('system')]
[switch]$System,
Expand Down Expand Up @@ -56,23 +70,23 @@ $script:ExportListFile = "$env:USERPROFILE\.config\mole\clean-list.txt"
function Show-CleanHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Clean$esc[0m - Deep cleanup for Windows"
Write-Host "$esc[1;35mmo clean$esc[0m - Deep cleanup for Windows"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole clean [options]"
Write-Host "$esc[33mUsage:$esc[0m mo clean [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -DryRun Preview changes without deleting (recommended first run)"
Write-Host " -System Include system-level cleanup (requires admin)"
Write-Host " -GameMedia Clean old game replays, screenshots, recordings (>90d)"
Write-Host " -Whitelist Manage protected paths"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --dry-run Preview changes without deleting (recommended first run)"
Write-Host " --system Include system-level cleanup (requires admin)"
Write-Host " --game-media Clean old game replays, screenshots, recordings (>90d)"
Write-Host " --whitelist Manage protected paths"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mExamples:$esc[0m"
Write-Host " mole clean -DryRun # Preview what would be cleaned"
Write-Host " mole clean # Run standard cleanup"
Write-Host " mole clean -GameMedia # Include old game media cleanup"
Write-Host " mole clean -System # Include system cleanup (as admin)"
Write-Host " mo clean --dry-run # Preview what would be cleaned"
Write-Host " mo clean # Run standard cleanup"
Write-Host " mo clean --game-media # Include old game media cleanup"
Write-Host " mo clean --system # Include system cleanup (as admin)"
Write-Host ""
}

Expand Down Expand Up @@ -145,7 +159,7 @@ function Show-CleanupSummary {
Write-Host " Categories: $($Stats.TotalItems)"
Write-Host ""
Write-Host " Detailed list: $esc[90m$($script:ExportListFile)$esc[0m"
Write-Host " Run without -DryRun to apply cleanup"
Write-Host " Run without --dry-run to apply cleanup"
}
else {
Write-Host " Space freed: $esc[32m${sizeGB}GB$esc[0m"
Expand Down Expand Up @@ -203,14 +217,14 @@ function Start-Cleanup {
#
# How to protect files:
# 1. Copy any path below to $($script:Config.WhitelistFile)
# 2. Run: mole clean -Whitelist
# 2. Run: mo clean --whitelist
#

"@
Set-Content -Path $script:ExportListFile -Value $header
}
else {
Write-Host "$esc[90m$($script:Icons.Solid) Use -DryRun to preview, -Whitelist to manage protected paths$esc[0m"
Write-Host "$esc[90m$($script:Icons.Solid) Use --dry-run to preview, --whitelist to manage protected paths$esc[0m"
Write-Host ""
}

Expand Down
39 changes: 21 additions & 18 deletions bin/optimize.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
param(
[Alias('dry-run')]
[switch]$DryRun,

[Alias('d')]
[switch]$DebugMode,

[Alias('h')]

[Alias('debug')]
[switch]$DebugMode,
Expand All @@ -32,7 +37,6 @@ $libDir = Join-Path (Split-Path -Parent $scriptDir) "lib"
# ============================================================================

$script:OptimizationsApplied = 0
$script:RepairsApplied = 0
$script:IssuesFound = 0
$script:IssuesFixed = 0

Expand All @@ -43,7 +47,7 @@ $script:IssuesFixed = 0
function Show-OptimizeHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Optimize$esc[0m - System optimization and repairs"
Write-Host "$esc[1;35mmo optimize$esc[0m - System optimization and maintenance"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mo optimize [options]"
Write-Host ""
Expand All @@ -63,6 +67,10 @@ function Show-OptimizeHelp {
Write-Host " mo optimize # Run all optimizations"
Write-Host " mo optimize --dry-run # Preview what would happen"
Write-Host ""
Write-Host "$esc[33mExamples:$esc[0m"
Write-Host " mo optimize # Run all optimizations"
Write-Host " mo optimize --dry-run # Preview what would happen"
Write-Host ""
}

# ============================================================================
Expand Down Expand Up @@ -483,7 +491,7 @@ function Repair-FontCache {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would stop Windows Font Cache Service"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would delete font cache files"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would restart Windows Font Cache Service"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}

Expand Down Expand Up @@ -516,7 +524,7 @@ function Repair-FontCache {

Write-Host " $esc[32m$($script:Icons.Success)$esc[0m Font cache rebuilt successfully"
Write-Host " $esc[90mNote: Some apps may need restart to see changes$esc[0m"
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not rebuild font cache: $_"
Expand Down Expand Up @@ -544,7 +552,7 @@ function Repair-IconCache {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would stop Explorer"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would delete icon cache files (iconcache_*.db)"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would restart Explorer"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}

Expand Down Expand Up @@ -579,7 +587,7 @@ function Repair-IconCache {

Write-Host " $esc[32m$($script:Icons.Success)$esc[0m Icon cache rebuilt ($deletedCount files cleared)"
Write-Host " $esc[90mNote: Icons will rebuild gradually as you browse$esc[0m"
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not rebuild icon cache: $_"
Expand Down Expand Up @@ -612,7 +620,7 @@ function Repair-SearchIndex {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would stop Windows Search service"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would delete search index database"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would restart Windows Search service"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}

Expand All @@ -631,7 +639,7 @@ function Repair-SearchIndex {

Write-Host " $esc[32m$($script:Icons.Success)$esc[0m Search index reset successfully"
Write-Host " $esc[33m$($script:Icons.Warning)$esc[0m Indexing will rebuild in the background (may take hours)"
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not reset search index: $_"
Expand All @@ -655,7 +663,7 @@ function Repair-StoreCache {

if ($script:DryRun) {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would run wsreset.exe"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}

Expand All @@ -670,7 +678,7 @@ function Repair-StoreCache {
else {
Write-Host " $esc[33m$($script:Icons.Warning)$esc[0m wsreset completed with code $($wsreset.ExitCode)"
}
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not reset Store cache: $_"
Expand All @@ -696,12 +704,8 @@ function Show-OptimizeSummary {
Write-Host ""

if ($script:DryRun) {
$total = $script:OptimizationsApplied + $script:RepairsApplied
Write-Host " Would apply $esc[33m$total$esc[0m changes"
if ($script:RepairsApplied -gt 0) {
Write-Host " ($($script:OptimizationsApplied) optimizations, $($script:RepairsApplied) repairs)"
}
Write-Host " Run without -DryRun to apply changes"
Write-Host " Would apply $esc[33m$($script:OptimizationsApplied)$esc[0m optimizations"
Write-Host " Run without --dry-run to apply changes"
}
else {
Write-Host " Optimizations applied: $esc[32m$($script:OptimizationsApplied)$esc[0m"
Expand Down Expand Up @@ -750,7 +754,7 @@ function Main {

$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mOptimize and Check$esc[0m"
Write-Host "$esc[1;35mOptimize and Maintain$esc[0m"
Write-Host ""

if ($script:DryRun) {
Expand All @@ -764,7 +768,6 @@ function Main {

# Run optimizations
Optimize-DiskDrive
Optimize-SearchIndex
Clear-DnsCache
Optimize-Network

Expand Down
19 changes: 13 additions & 6 deletions bin/purge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
#Requires -Version 5.1
[CmdletBinding()]
param(
[Alias('d')]
[switch]$DebugMode,

[Alias('p')]
[switch]$Paths,

[Alias('h')]
[Alias('debug')]
[switch]$DebugMode,

Expand Down Expand Up @@ -79,14 +86,14 @@ $script:ItemsCleaned = 0
function Show-PurgeHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Purge$esc[0m - Clean project build artifacts"
Write-Host "$esc[1;35mmo purge$esc[0m - Clean project build artifacts"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole purge [options]"
Write-Host "$esc[33mUsage:$esc[0m mo purge [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -Paths Edit custom scan directories"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --paths Edit custom scan directories"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mDefault Search Paths:$esc[0m"
foreach ($path in $script:DefaultSearchPaths) {
Expand Down Expand Up @@ -555,7 +562,7 @@ function Main {

if ($null -eq $searchPaths -or $searchPaths.Count -eq 0) {
Write-MoleWarning "No valid search paths found"
Write-Host "Run 'mole purge -Paths' to configure search directories"
Write-Host "Run 'mo purge --paths' to configure search directories"
return
}

Expand Down
7 changes: 4 additions & 3 deletions bin/status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#Requires -Version 5.1
param(
[Alias('h')]
[switch]$ShowHelp
)

Expand All @@ -17,12 +18,12 @@ $binPath = Join-Path $windowsDir "bin\status.exe"
function Show-StatusHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Status$esc[0m - Real-time system health monitor"
Write-Host "$esc[1;35mmo status$esc[0m - Real-time system health monitor"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole status"
Write-Host "$esc[33mUsage:$esc[0m mo status"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -ShowHelp Show this help message"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mDisplays:$esc[0m"
Write-Host " - System health score (0-100)"
Expand Down
15 changes: 10 additions & 5 deletions bin/uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
#Requires -Version 5.1
[CmdletBinding()]
param(
[Alias('d')]
[switch]$DebugMode,

[Alias('r')]
[switch]$Rescan,

[Alias('h')]
[switch]$ShowHelp
)

Expand Down Expand Up @@ -37,14 +42,14 @@ $script:CacheTTLHours = 24
function Show-UninstallHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Uninstall$esc[0m - Interactive application uninstaller"
Write-Host "$esc[1;35mmo uninstall$esc[0m - Interactive application uninstaller"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole uninstall [options]"
Write-Host "$esc[33mUsage:$esc[0m mo uninstall [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -Rescan Force rescan of installed applications"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --rescan Force rescan of installed applications"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mFeatures:$esc[0m"
Write-Host " - Scans installed programs from registry and Windows Apps"
Expand Down
7 changes: 6 additions & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "& '%MOLE_DIR
$batchPath = Join-Path $InstallDir "mole.cmd"
Set-Content -Path $batchPath -Value $batchContent -Encoding ASCII
Write-Success "Created launcher: mole.cmd"

# Also create 'mo' alias
$moPath = Join-Path $InstallDir "mo.cmd"
Set-Content -Path $moPath -Value $batchContent -Encoding ASCII
Write-Success "Created launcher: mo.cmd (short alias)"

# Add to PATH if requested
if ($AddToPath) {
Expand All @@ -340,7 +345,7 @@ powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "& '%MOLE_DIR
Write-Host ""

if ($AddToPath) {
Write-Host " Run 'mole' from any terminal to start"
Write-Host " Run 'mo' or 'mole' from any terminal to start"
}
else {
Write-Host " Run the following to start:"
Expand Down
Loading