-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
In Disable-LanmanCache.ps1, the restart prompt guard uses if (-not $WhatIf), but $WhatIf is never declared as a parameter. It will always evaluate to $null (falsy), so the restart prompt always appears regardless of -WhatIf usage.
Expected Behavior
When running with -WhatIf, the restart prompt (Read-Host) should be suppressed.
Actual Behavior
$WhatIf is always $null, so the prompt always shows. The ShouldProcess calls on the registry operations work correctly, but the restart prompt escapes the WhatIf guard.
Fix
Replace if (-not $WhatIf) with a proper check, such as:
if (-not $WhatIfPreference) {
# prompt for restart
}Files Affected
Scripts/Registry/Disable-LanmanCache.ps1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working