I'm trying to create a simple script which run a command and send the output to a variable. this is the script:
$output = &"<Path to PLINK>\PLINK.exe" -ssh <username>@<IP Address> -pw <password> "my command"
the thing is the command im running is like "top" in linux - a task manager which won't quit until enter is being pressed.
how can i take the CLI output from that situation without touching my keyboard?
i wrote an automation with opening cmd and sending "keys" function inorder to get what i want but i cannot get the output from the CLI by doing so. (also i dont beleive its the right way.)
Thanks in advance.