
#it #naukaprogramowania #powershell #windows10 #cmd
Ej, Mireczki
Do tej pory używałem cmd i gdy wywoływałem jakiegoś execa mogłem mu podać dane wejściowe przez "<"
I on mi wypluwał jakieś dane.
Jak takie coś zrobić w PowerShellu?
Ej, Mireczki
Do tej pory używałem cmd i gdy wywoływałem jakiegoś execa mogłem mu podać dane wejściowe przez "<"
test.exe < input.txt
I on mi wypluwał jakieś dane.
Jak takie coś zrobić w PowerShellu?
- Najlepsze
- Wszystkie komentarze







Start-Process -FilePath "test.exe" -ArgumentList "input.txt"Ale on nie chce test.exe input.txt.
mam jakiś plik exe, któremu zamiast z palca chce z pliku txt wprowadzić dane, polecenia, a później żeby mi to wypluł do pliku co by było najlepsze lub do shella.
Gdy wpisuje:
test.exe -i input.txt to jakby tego nie przyjmował tylko uruchamiał samego execa.
$Argument = Get-Content -Path input.txtStart-Process -FilePath "test.exe" -ArgumentList $Argument
W bashu robi się to banalnie prosto, a w PowerShellu jakieś kombinacje.
Jest sens w ogóle uczyć się PowerShella? Prawie wszystko na Windowsie można zrobić w
Start-Process -FilePath "test.exe" -ArgumentList (Get-Content -Path input.txt)