Error: pwsh.exe is not recognized as a command or operable program

Teja Alavelli 0 Reputation points
2025-02-20T07:39:22.6366667+00:00

I have 7 runbooks scheduled to run daily but there failed with exception error starting this week. runbooks were working fine previously on schedule.

I can run manually successfully but it take long time at Queued status and end up failed on schedule.

Error as following:

pwsh.exe is not recognized as a command or operable program. Install the language interpreter and add the installation path to PATH environment variable. If installation was done recently, restart the Hybrid Worker Service for extension based installation or restart the Microsoft Monitoring Agent for agent based installation. Looking for the executable at default location C:\PowerShell7\pwsh.exe.

anyone can share how to resolve the above error with steps by steps?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,321 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pavan Minukuri 1,225 Reputation points Microsoft Vendor
    2025-02-24T10:32:59.67+00:00

    Hi Teja Alavelli
    Thanks for reporting the issue,
    Please update your power shell latest one (7.1 or 7.2) and try it.

    Similar issue one of our community members faced please refer this https://learn.microsoft.com/en-us/answers/questions/1485574/automation-job-failed-recently-with-exception-errohttps://learn.microsoft.com/en-us/answers/questions/1485512/runbook-jobs-getting-queued-status

    Please let us know if you required anything!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.