How to Utilise PowerShell to Scan Windows 10/11 for Malware – Guide

Windows Defender Antivirus is a powerful and real-time antivirus software that helps protect your computer from viruses, ransomware, spyware, rootkits, and many other types of malware. It is also one of our best antivirus software.

You can use PowerShell to automate some of the tasks that are available through the Windows Security application, such as scheduling a quick or full scan or a signature update. You can also use PowerShell to speed up the setup process, especially when you need to apply the same settings across multiple installations of Windows 10.

What is PowerShell?

  1. Open the Start Menu and type " PowerShell “.
  2. The PowerShell window will open.
  3. Type " New-Item “.
  4. Type " cmd “.
  5. Type " Set-ItemProperty -Path ’ C:\Windows\System32\powershell ’ -Value ’ $env:COMMAND ’ .
  6. Type " Get-ItemProperty -Path ’ C:\Windows\System32\powershell ’ -Name ’ $env:COMMAND ‘.

Windows PowerShell is a powerful tool that can be used to manage your computer.

Right-click Windows PowerShell and click Run as administrator and select “Run as administrator on this computer”

Check Microsoft Defender Status Using PowerShell

Get-MpPreference -Name “Microsoft Defender” The command below gets the detailed status of the anti-malware software installed on your Windows PC. After starting Windows PowerShell as an administrator, type the following command and press Enter to check the status of Microsoft Defender: Get-MpPreference -Name “Microsoft Defender” | Format-List Status,LastCheckTime ..

If you have Microsoft Defender installed on your computer, it is likely that it is properly configured and running. However, in the event that Microsoft Defender is not enabled on your computer, you can easily enable it. Additionally, you can run anti-malware scans to help keep your computer safe. ..

How to Update Microsoft Defender Using PowerShell

Get-WindowsFeature -Name “Microsoft Defender” -UpdateLevel “1” This command updates the Microsoft Defender anti-malware software on your computer.

CMDlet download Microsoft Defender definition updates If you want to download the latest Microsoft Defender definition updates from a specific location, you can use the following command:

  1. Open the Microsoft Defender preferences.
  2. Click on the Update tab.
  3. Under “When checking for updates,” select “Every day.” ..

Run a quick antivirus scan using PowerShell

Get-WmiObject -Class Win32_Virus -ComputerName $computer -Filter “Name=’*’” ..

Run a full antivirus scan using PowerShell

netstat -an | grep “HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion” This will show all the active Windows NT processes and their associated files.

C:\Windows\system32\background_scan.exe

After successfully executing the commands, Microsoft Defender will run a full and detailed malware scan of your Windows 10 computer. This scan will include scanning for any and all known malware, as well as any and all potential threats that may be present on your computer.

Microsoft Defender Offline Scanning

Get-WmiObject -Class Win32_OperatingSystem | Where-Object {$_.Version -eq “10.0”} | New-Object PSObject -Property @{OS=“Windows 10”;Name=“OfflineScanner”;Path=“C:\Program Files (x86)\Microsoft Defender\ offlinescanner.exe”} ..

This cmdlet will make Windows 10 boot into Windows Defender offline mode and scan the entire system for malware. After your computer boots, you will see the Windows Defender Antivirus loading screen followed by a command prompt window that will display the offline scan progress. When testing is complete, you can view the scan report offline by navigating to Windows Security > Virus & Threat Protection > Protection History.

Schedule a quick antivirus scan using PowerShell

scheduledscan -days “Monday, Tuesday, Wednesday, Thursday” This will schedule a quick scan on Monday, Tuesday, Wednesday, and Thursday.

sudo scan_time 2pm ..

cmdlet -name quickscan -time 0

Schedule a full antivirus scan using PowerShell

Get-Windows10SystemScan -ComputerName “MyPC”

Get-WmiObject -Class Win32_OperatingSystem | Select-Object -Property Caption Windows 10 Home 64-bit Windows 10 Pro 64-bit ..

Scan_Day=1 ..

Get-Date | Select Scan_Time ..

Final note

This guide is for people who want to use PowerShell to scan their Windows 10 or 11 systems for malware. If you have any questions about this article, please don’t hesitate to ask us. Additionally, please share this guide with your friends so that they can too benefit from it.