Issue Resolved: Jenkins Pipeline Job-powershell command not found
We have a requirement to run powershell commands from pipeline job. Our jenkins cluster have multiple nodes(linux and windows). Newly created job assigned to a windows slave but gives below error while running. Jenkins Version-Jenkins ver. 2.209
The term 'powershell' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
In this case we can solve the issue by giving absolute path of powershell.exe in the node environment variable.
Go to Jenkins ==>Nodes==>Select the Node.
Then Go to Configuration ==> Environment variables ==>Path and add in the end ;C:\Windows\System32\WindowsPowerShell\v1.0
This will fix the issue.