Hello,
As a start you could double-check if you have installed the PowerShell Core successfully; if you have enough permission to access that pwsh file or directory; If the installed directory is added to the environment variable $PATH.
You could run echo $PATH to check the current PATH configuration and run export PATH=$PATH:/xxx/xxx to add a directory into the $PATH.
Also you can consider Installing Terraform on Windows with Bash
https://learn.microsoft.com/en-us/azure/developer/terraform/get-started-windows-bash?tabs=bash
Test Terraform modules in Azure using Terratest
https://learn.microsoft.com/en-us/azure/developer/terraform/test-modules-using-terratest
Alternative Terraform worker image TFE runs terraform plan and terraform apply operations in a disposable Docker containers. There are cases where runs may make frequent use of additional tools that are not available in the default Docker image. To allow use of these tools for any plan or apply, users can build their own image and configure TFE to use that instead. In order for this to happen the name of the alternative docker image must be set in the config by using the Custom image tag field
-----------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--