Use PowerShell to fix Defender three ways: refresh signatures with Update-MpSignature, clear broken exclusions with Get-MpPreference and Remove-MpPreference, or check the Defender service state when scans will not start. Using the wrong fix wastes time and can leave malware definitions stale or exclusions still blocking scans. This guide shows which PowerShell command to try first for each problem on Windows 10 and Windows 11.
What a Defender reset in PowerShell fixes
A PowerShell “reset” usually does not mean one command that restores every Microsoft Defender Antivirus setting. It usually means one of three actions: force new definition files, remove bad exclusion entries, or check why Defender will not start correctly. That distinction matters because each symptom points to a different fix.
Microsoft Defender Antivirus is the built-in Windows security component that handles definition updates, scan behavior, and protection settings. Windows PowerShell should be run as administrator for Defender cmdlets, and UAC will usually prompt for elevation before those changes are allowed.
Likely causes, from most common to least common
- Outdated Defender signatures.
- Corrupted or stale exclusion entries in the Windows Defender exclusion list.
- Defender stuck starting, or missing from the Security app view.
- Execution policy or admin-rights blocks.
Say your quick scan keeps failing on a Windows 10 laptop and Defender reports old definitions. That points first to Update-MpSignature, not to exclusions or execution policy. If scans fail only for one folder or process after a settings change, that points more strongly to a bad exclusion entry.
Do you need to run PowerShell as administrator?
Yes. Defender cmdlets change protected security settings, so you need Windows PowerShell opened with Run as administrator. If you skip elevation, UAC may block the command or the cmdlet may return an access error. This applies on Windows 10 and Windows 11.
- Open an elevated PowerShell window. Search for Windows PowerShell, right-click it, and choose Run as administrator. When the UAC prompt appears, choose Yes.
- Confirm the window is elevated. The title bar should show Administrator. If it does not, close it and reopen with elevation, because Defender cmdlets may fail without admin rights.
- Check the symptom first. If the problem is old signatures, go to the update command. If the problem is a blocked scan for one path or process, inspect exclusions first.
Windows Defender reset decision table
Use this table to pick the right PowerShell action before you try anything else. The command column shows the exact step to start with, not a full repair sequence.
| Symptom | Command | Expected result | Common failure reason |
|---|---|---|---|
| Defender signatures are outdated | Update-MpSignature |
Definitions refresh and the current signature version updates | Windows PowerShell was not opened as administrator |
| Scan keeps skipping one folder or app | Get-MpPreference |
You can read the exclusion list and see ExclusionPath or ExclusionProcess entries |
Wrong shell context, or the exclusion is managed elsewhere |
| Broken exclusions appear after changes | Remove-MpPreference |
The named exclusion entry is removed from Defender preferences | The command did not target the exact path or process name |
| Defender is stuck starting | Get-Service WinDefend |
You can check whether the Defender service exists and its status | The service is disabled, stopped, or blocked by policy |
| Defender does not show correctly in the UI | Get-MpPreference plus a service check |
You can confirm whether preferences load and the service state is healthy | The issue is not a definition problem, so signature refresh alone will not help |
| PowerShell script is blocked by policy | Set-ExecutionPolicy |
Script execution policy changes long enough to run the script | Execution policy is being treated like a Defender reset, which it is not |
Outdated Defender signatures: refresh definitions first
If the problem is an outdated scan engine or stale malware definitions, Update-MpSignature is the first command to try. Microsoft Defender Antivirus depends on current definition files, and a signature refresh is the fastest fix when protection seems behind.
- Open elevated PowerShell. Use Run as administrator so the cmdlet can modify Defender’s update state.
- Run the update command. Enter
Update-MpSignatureand wait for it to complete. If the system is online, this requests a definition refresh for Microsoft Defender Antivirus. - Verify the result. Run a quick scan from Windows Security after the command finishes. If the definitions still do not update, check Windows Update next.
A common first-timer mistake is to start with exclusions when the real issue is stale definitions. If the update succeeds, scan behavior may return to normal without changing any preferences.
Corrupted exclusions: clear the bad entry
When Defender skips a file, folder, or process that should be scanned, the exclusion list is the first place to check. The Windows Defender exclusion list can accumulate unwanted ExclusionPath and ExclusionProcess entries that block scans or trigger false positives.
- Read current preferences. Run
Get-MpPreferencein elevated PowerShell and look forExclusionPathandExclusionProcessvalues. - Match the bad entry. Confirm the exact path or process name before removing anything. A single wrong character can leave the broken exclusion in place.
- Remove the entry. Use
Remove-MpPreferencewith the specific exclusion value you want to clear. Remove only the entry tied to the problem, then rescan. - Recheck Defender. Run another
Get-MpPreferencequery or start a scan to confirm the exclusion is gone and detection works again.
If a build tool in C:\Tools\Agent is excluded and Defender never scans that folder, remove only that path. That is safer than changing broader protection settings, because the scan behavior changes without disturbing unrelated rules.
Defender stuck starting: check the service state
If Defender will not start, shows missing status in the Security app, or ignores a definition refresh, the problem may be deeper than signatures or exclusions. In that case, check the Defender service state before moving to broader Windows repair steps.
- Check the service. Run
Get-Service WinDefendin elevated PowerShell to see whether the service is present and what status it reports. - Check for policy blocks. If the service is stopped or disabled, look for local policy or security software that may be controlling Defender. Do not treat this as an execution-policy issue.
- Restart Windows. Reboot after the check, then retry
Update-MpSignature. A restart can clear a temporary startup fault that keeps the service from loading cleanly.
Execution policy blocks and command errors
Set-ExecutionPolicy controls script execution policy, but it is not a Defender reset. Use it only when PowerShell refuses to run a script because policy blocks it. Do not use it as routine cleanup, and do not treat it as a substitute for fixing signatures or exclusions.
- Confirm the error source. If PowerShell says scripts are disabled or blocked, the issue is execution policy. If the error mentions Defender cmdlets not found, the shell or module context is the more likely problem.
- Change policy only if needed. Run
Set-ExecutionPolicywith the least permissive temporary setting that lets the script run, then use the script you need. - Return to normal handling. Avoid leaving policy changes in place longer than necessary. If the issue is Defender itself, go back to
Update-MpSignature,Get-MpPreference, or a service check instead.
If commands fail with “not recognized,” check that you are in Windows PowerShell and not a different shell profile. The cmdlets need the Defender module context, and they also need admin elevation for settings changes.
Still not working?
If Update-MpSignature fails, exclusions are clean, and the service still looks wrong, move to Windows repair steps. Check Windows Update first, then run SFC /scannow from Command Prompt, and verify automatic time and time zone settings are correct. If the Security app is broken, use its Advanced options repair path and, if repair fails, use Reset.
- Check Windows Update. Install pending updates, then restart. Defender component fixes often arrive through standard Windows servicing.
- Verify time settings. Open Date & time settings and confirm automatic time and time zone are enabled. Incorrect time can interfere with definition updates.
- Run SFC. Open Command Prompt and run
SFC /scannow. This checks Windows files that Defender depends on. - Repair the Security app. Go to Settings > Apps > Installed apps, open the app’s Advanced options, then choose Repair. If repair fails, click Reset.
Review Defender exclusions before adding new ones, and remove entries you no longer need. That keeps the exclusion list from filling with old paths and process names.
Frequently asked questions
How do I reset Windows Defender with PowerShell?
There is no single PowerShell command that resets every Defender setting to defaults. Start with Update-MpSignature for stale definitions, Get-MpPreference for exclusions, and Remove-MpPreference for bad entries. Run PowerShell as administrator first, or the cmdlets may fail.
What PowerShell command resets Microsoft Defender?
The closest practical action is Update-MpSignature for definitions or Remove-MpPreference for unwanted exclusions. If Defender will not start, check Get-Service WinDefend instead of assuming one reset command will fix everything.
How do I reinstall or repair Windows Defender in Windows 11 with PowerShell?
Defender is built into Windows 11, so there usually is nothing to reinstall with PowerShell. Start with Update-MpSignature, then check exclusions with Get-MpPreference. If the app interface is broken, use the Security app’s Advanced options repair path.
Why does Windows PowerShell keep popping up?
That usually means a script, scheduled task, startup item, or admin tool is launching PowerShell in the background. Check Task Scheduler, startup apps, and any security or maintenance tools that run scripts. If a policy prompt appears, it may be from UAC or execution policy, not Defender.
How do I reset Windows Defender in Windows 10 PowerShell?
Windows 10 uses the same Defender cmdlets as Windows 11 for this purpose. Open Windows PowerShell as administrator, run Update-MpSignature for definitions, and use Get-MpPreference plus Remove-MpPreference for exclusions that block scans.
Can I clear Defender exclusions with PowerShell?
Yes. Use Get-MpPreference to list ExclusionPath and ExclusionProcess entries, then remove the exact bad entry with Remove-MpPreference. Keep the path or process name exact, or the exclusion may remain in place.
Do I need to run PowerShell as administrator to reset Defender?
Yes. Defender cmdlets modify protected security settings, so Windows PowerShell must be opened with Run as administrator. UAC should prompt for approval, and that elevation is required before settings changes or signature updates will reliably apply.
What should I do if Update-MpSignature does not work?
Check Windows Update, confirm the date and time are correct, and verify that PowerShell is running as administrator. If the command still fails, inspect the Defender service with Get-Service WinDefend and run SFC /scannow from Command Prompt if system files may be damaged.