powershell - Piping Read-Host does not wait for input -
i'm new powershell , want make tests. example command wait user input:
powershell -command "read-host test"
but if i'm piping "read-host test" powershell not waited input. here how looks in shell:
ps f:\> powershell -command "read-host test" test: input input ps f:\> "read-host test" | powershell -command - test: ps f:\>
does know why there difference on both commands?
try this
powershell -command "cat test.txt" | powershell -noexit -command -
executes specified commands (and parameters) though typed @ windows powershell command prompt, , exits, unless noexit specified. value of command can "-", string. or script block.
Comments
Post a Comment