.\ubuntu1804.exe
by itself opens an interactive shell which PowerShell executes synchronously.
That is, until you submit exit
in that interactive shell to terminate it, control won't be returned to PowerShell, so the subsequent commands - cd test_directory
and note server.js
- are not only not sent to .\ubuntu1804.exe
, as you intended, but are then run by PowerShell.
Instead, you must pass the commands to run to .\ubuntu1804.exe
via the run
sub-command:
.\ubuntu1804.exe run 'cd test_directory; node server.js'
Note: Once node
exits, control will be returned to PowerShell.