Forum Discussion
DominikWittassek
Mar 23, 2022Copper Contributor
Pipe Content of file in dynamic execution of a command
Hi there!
This is the challenge:
I create a file in a dynamic location, based on former input.
The I need to pipe the contents of this file into a commandline which also has dynamic parameters:
Get-Content $sourcepath\password.xml | $sourcepath"\hdbinst.exe --silent --batch --path="$global:installpath" --agent_instance="$global:agentname" --service_user="$global:serviceuserdomain"\"$global:serviceuser" --read_password_from_stdin=xml"
But of course I get the error that expressions are only allow as first element of a pipeline.
Can anyone help?
6 Replies
Sort By
- Is your XML file formatted like this? https://help.sap.com/viewer/2c1988d620e04368aa4103bf26f17727/2.0.06/en-US/c2b981c320d84676a0bd9b2bd0c2bf2b.html (It's a Linux example, but I guess it's the same because you're installing SAP right? And is your XML UTF-8?
- DominikWittassekCopper ContributorIts not the format of the xml doesn't matter. Yes, its a SAP solution.
I managed to run it with
cmd /c $installcmd- Ok, and $installcmd contains? (If that's the solution, it's good to post it here)
- Do you have a example/adjusted XML file?