forked from ScoopInstaller/Scoop
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47aac5b
commit 222bac5
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<# | ||
Diagnostic tests. | ||
Return $true if the test passed, otherwise $false. | ||
Use 'warn' to highlight the issue, and follow up with the recommended actions to rectify. | ||
#> | ||
|
||
|
||
function check_windows_defender($global) { | ||
$defender = get-service -name WinDefend -errorAction SilentlyContinue | ||
if($defender -and $defender.status) { | ||
if($defender.status -eq [system.serviceprocess.servicecontrollerstatus]::running) { | ||
$hasGetMpPreference = gcm get-mppreference -errorAction SilentlyContinue | ||
if($hasGetMpPreference) { | ||
$installPath = $scoopdir; | ||
if($global) { $installPath = $globaldir; } | ||
|
||
$exclusionPath = (Get-MpPreference).exclusionPath | ||
if(!($exclusionPath -contains $installPath)) { | ||
warn "Windows Defender may slow down or disrupt installs with realtime scanning." | ||
write-host " Consider running:" | ||
write-host " sudo Add-MpPreference -ExclusionPath '$installPath'" | ||
write-host " (Requires 'sudo' command. Run 'scoop install sudo' if you don't have it.)" | ||
return $false | ||
} | ||
} | ||
} | ||
} | ||
return $true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Usage: scoop checkup | ||
# Summary: Check for potential problems | ||
# Help: Performs a series of diagnostic tests to try to identify things that may | ||
# cause problems with Scoop. | ||
|
||
. "$psscriptroot\..\lib\core.ps1" | ||
. "$psscriptroot\..\lib\diagnostic.ps1" | ||
|
||
$issues = 0 | ||
|
||
$issues += !(check_windows_defender $false) | ||
$issues += !(check_windows_defender $true) | ||
|
||
if($issues) { | ||
warn "`nFound $issues potential $(pluralize $issues problem problems)." | ||
} else { | ||
success "No problems identified!" | ||
} | ||
|