0

How to let PowerShell use file as input to an executable?

for example, a directory like this

test.txt
text.exe

how to use test.txt as the input of test.exe in PowerShell?

ygy
  • 24
  • 1
  • 6

1 Answers1

0

Something like this should work

$settings =get-content "Path\test.txt"
$filename = "Path\text.exe"
Start-Process -FilePath $filename  -ArgumentList $settings
Simon B
  • 210
  • 1
  • 5