Forum Discussion

DominikWittassek's avatar
DominikWittassek
Copper Contributor
Mar 23, 2022

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

Resources