I have a AWSShellScript task that executed a powershell script – example below trimmed for this post.
-task: AWSShellScript@1
inputs:
scriptType: inline
inlineScript: 'pwsh -File test-script.ps1 -path 'pathvalue;
The script above passes the value “pathvalue” to the script and everything works as expected.
The problem I have is that the value is actually “/pathvalue” and I unfortunately cannot remove the leading “/” from the string as its part of a legacy systems that can’t currently be changed.
When passing this value, the string value itself is changed by the task presumably and instead of receiving “/pathvalue”, the script recieves “c:/program files/git/pathvalue”.
Does anybody know how to stop parameters appended with “/” from being treated as a relative path and appending the folder?