Jenkins - cannot run WinRMClient Plugin with Powershell command

I am trying to run WinRMClient Plugin on my Jenkins slave (alpine docker). plugins-wiki-docs/README.md at 9162c2f7e00d43ad3b7af1cc1c918ad7b3368475 · jenkins-infra/plugins-wiki-docs · GitHub I installed the powershell and all dependent libraries with curl, and make a symbolic link to access the “powershell” command which is being triggered by the Plugin.

Now I want to run WinRMClient commands so I defined this in Pipeline step:

    stage ('WinRM stage') {
      steps {
        winRMClient credentialsId: 'ac0c0', hostName: '10.1.175.143',
        winRMOperations: [invokeCommand('dir'), sendFile(configurationName: 'DataNoLimits', destination: 'C:\\', source: 'package.json')]
      }
    }

But I am getting the following error in Console Output:

[Pipeline] winRMClient
$ docker exec bcf03f18dea9 powershell -NonInteractive 
"& '/tmp/jenkins1345282096390549594.ps1'"
The argument '& '/tmp/jenkins1345282096390549594.ps1'' is not recognized 
as the name of a script file. 
Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.

I don’t know how I can resolve this. I cannot effect how this Plugin invokes its methods (WinRMClient and WinRMOperations).

What can I do? Please help!

Thanks

Hey, Im having the same struggle.
Did you manage to solve it? if you did, can you share how?

I didn’t resolve this