Powershell script failing when run in playbook - works on other servers and runs ok manually on target host - cannot find path

The play copies a powershell script and runs it on the target - the script looks up files in C:\Temp. This path definitely exists.

I can run this play without issues against other test servers - now that I want to run this play on the actual server I want to configure I get the below error…

fatal: [servername]: FAILED! => {“changed”: true, “msg”: “non-zero return code”, “rc”: 1, “stderr”: "Get-ChildItem : Cannot find path ‘C:\Temp’ because it does not exist.\r\nAt C:\Users.…

Running the same Powershell script locally on the target server returns a json file - no errors thrown.

WinRM config etc is all ok.

Let me know if you need more info…

Thanks!

OK - issue resolved… was targeting wrong server in inventory file!