# Windows Defender & Event Viewer

**URL:** <https://forums.powershell.org/t/windows-defender-event-viewer/14777>\
**Category:** PowerShell Help\
**Created:** [August 10, 2020, 8:31am UTC](https://forums.powershell.org/t/windows-defender-event-viewer/14777 "2020-08-10T08:31:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![john54131](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@john54131](https://forums.powershell.org/u/john54131)\
**Post date:** [August 10, 2020, 8:31am UTC](https://forums.powershell.org/t/windows-defender-event-viewer/14777/1 "2020-08-10T08:31:19Z")

</div>

I’m trying to write a PowerShell script to automate some scanning activities using Windows Defender. I’ve noticed a limitation with the published code which I’m interested to know whether or not there is a workaround.

Is there any reason why when you run this:

```
Start-MpScan -ScanType CustomScan -ScanPath "C:\Files"
```

That the scan does not get added into the event viewer?

I need this because I need a way to keep a log of what files were scanned? If I could output the results of the scan directly from PowerShell that would be even better but I don’t believe this function returns anything. Any pointers appreciated.

---

<div class="post-metadata">

**Author:** ![alex-aymonier](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@alex-aymonier](https://forums.powershell.org/u/alex-aymonier)\
**Post date:** [September 7, 2020, 8:46pm UTC](https://forums.powershell.org/t/windows-defender-event-viewer/14777/2 "2020-09-07T20:46:25Z")

</div>

Your code look a little wonky

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:28pm UTC](https://forums.powershell.org/t/windows-defender-event-viewer/14777/3 "2024-05-16T20:28:55Z")

</div>

Closed on May 16, 2024, 8:28pm UTC


