I am trying to run a PowerShell script in Flow Designer action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 02:30 AM
I have created a MID Server script file and used the 'PowerShell' step in Flow Designer. I have set up a connection alias, too. But when I run a test on it, it gives an error- Invalid invocation: 'PowerShell execution requires MID'.
What exactly is MID, and how can I set it up for my PowerShell script?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Please check if the credential being used has "Use MID Server" checked and the "MID Selection" is chosen as per your environment setup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @TBharati ,
Possible reasons for this error include:
- MID Server Unavailability or Misconfiguration:
The MID Server might be offline, not properly configured, or not reachable from the ServiceNow instance.
- Incorrect PowerShell Path:
The mid.powershell.path parameter on the MID Server might be incorrectly configured, pointing to a non-existent or incorrect path for the PowerShell executable.
- PowerShell Execution Policy Restrictions:
The PowerShell execution policy on the MID Server host might be set to a restrictive level (e.g., AllSigned or RemoteSigned) that prevents the execution of unsigned scripts, which can be the case for scripts triggered by ServiceNow. Setting it to Unrestricted is often a workaround, though it has security implications.
- PowerShell Version Incompatibility:
The PowerShell version on the MID Server might not meet the minimum requirements for the specific operation being attempted (e.g., requiring PowerShell 2.0 or greater).
- Credential or Permission Issues:
The credentials used by the MID Server to execute PowerShell commands on the target system might be invalid or lack the necessary permissions.
If my answer helepd you, please mark it solution accepted.
Regards,
Nikhil Bajaj
Regards,
Nikhil Bajaj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago