How to Fix Microsoft Defender for Endpoint Detection Test Incomplete
Question details
The user needs to resolve an issue where the initial device detection test in Microsoft Defender for Endpoint remains incomplete despite the device being successfully onboarded to Intune.

- Product
- Microsoft Defender for Endpoint
- Device & OS
- not provided
- Scenario
- Running the initial detection test script after onboarding a device to Intune and Microsoft Defender for Endpoint.
- Observed behavior
- The detection test fails to complete, and the provided PowerShell command returns an error stating that 'Continue=' is not recognized.
Ensure you have administrative privileges on the device and access to the Microsoft Defender Security Center. Verify that your device meets the minimum OS requirements for onboarding and has a stable internet connection.
Verify and Correct PowerShell Command Syntax
Resolve syntax errors caused by improper formatting or unintended line breaks when copying the detection script from documentation.
When copying commands from web pages or PDF documents, hidden formatting characters or line breaks are often introduced. This causes PowerShell to misinterpret commands, resulting in errors such as 'Continue=' not being recognized.
Open the detection script documentation provided in the Microsoft Defender for Endpoint onboarding portal and copy the text.
Paste the copied script into a plain text editor like Notepad. This strips away any hidden HTML or rich-text formatting characters.
Review the text for any unintended line breaks, especially around the 'Continue=' parameter. Ensure the command is on a single continuous line if the syntax requires it.
Open PowerShell with Administrator privileges, paste the sanitized command, and press Enter to execute the detection test.

Consult Microsoft Support and Communities
If the device is onboarded but the script continues to fail, escalate the issue to specialized experts.
Discover a Lightweight Alternative for Your Office Needs
While troubleshooting enterprise security policies requires specialized IT support, managing your daily documents shouldn't. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, allowing you to edit Word, Excel, and PowerPoint files seamlessly without heavy system resource consumption.
- 1. Visit the official website: Go to the official WPS Office website to access the latest version.
- 2. Download the installer: Click the Free Download button matching your operating system.
- 3. Install and launch: Run the setup file and follow the quick on-screen instructions to start using your new workspace.

Frequently Asked Questions
Why does PowerShell say 'Continue=' is not recognized?
This typically happens when the command is copied from a formatted document or webpage that introduces hidden characters, incorrect quotation marks, or unintended line breaks, which break the native script syntax.
How do I verify if my device is properly onboarded to Defender?
You can check the device inventory in the Microsoft Defender Security Center. If the device appears there with an active status, it has been successfully onboarded, even if the local detection test script is still pending.
How long does a Microsoft Defender detection test usually take to appear?
Once the PowerShell script is executed successfully, the alert should trigger and appear in the Microsoft Defender portal within a few minutes. However, slight delays can occur depending on network synchronization intervals.




