Notifications

14 views

Description

Discovery failing on Error: Missing expression after unary operator

When I run discovery I notice the error: 
"Error: Missing expression after unary operator '-'.At line:1 char:2+ -E <<<< xecutionPolicy ByPass -NonInteractive -WindowStyle Hidden -command &"

Cause

The error happens when running the command '-ExecutionPolicy ByPass -NonInteractive -WindowStyle Hidden' so you can test this by running the following command on the affected MID Server and check the output text file to see if it has the same error or not.

# powershell -ExecutionPolicy ByPass -NonInteractive -WindowStyle Hidden > C:\SampleFolder\output.txt

Observe the Powershell version that your MID Server is using?

PowerShell version 1.0 running on remote mid server or remote host.

Minimum pre-requisite for PowerShell is v2.0

Resolution

Ask if PowerShell can be upgraded to 2.0 or higher to satisfy Discovery requirements.

Confirm after upgrade PowerShell 2.0 or higher resolved the issue.

Article Information

Last Updated:2019-10-23 07:11:49
Published:2019-10-23