Mar 23 2022 07:37 AM
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?
Mar 23 2022 07:55 AM
Mar 23 2022 12:11 PM
Mar 23 2022 12:27 PM
Mar 23 2022 12:31 PM
Mar 23 2022 12:47 PM - edited Mar 23 2022 12:48 PM
$installcmd="more " +$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"
Cmd /c $installcmd
Sorry for the formatting, I post from my mobile
Mar 23 2022 12:51 PM