As part of a Jenkins build process, I'd like to run a powershell script on the target machine. The target and source machines are both running Windows Server 2016.
I have a SSH configuration set up to the target machine. I'm using the Publish Over SSH plugin for this. The first thing I noticed is that the SSH configuration seems to not respect my remote directory. I have the following for the remote directory ../../inetpub/wwwroot/MyProject/bin
. I've tested this path in an SSH session outside of Jenkins and it takes me where I need to be.
However, if I run echo %CD%
as the command in Exec Command, it returns C:/Users/Administrator
. Also, if I try accessing anything in the path ../../inetpub/wwwroot/MyProject/bin
, I get file not found issues.
I'm able to run the powershell file if I provide the full path, but I would like to have the remote directory put me in the correct directory, in case anything changes.
C:/inetpub/wwwroot/MyProject/bin
. Is there a way to specify that without the drive letter? I could create a simlink underC:\Users\Administrator
, but that seems wrong.