Because Invoke-SshCommand is not executing in a shell but using SSH Exec to execute the command so the "cd" does nothing to change a current working directory because you are not in a shell. You would need to create a shell stream and execute your commands inside of it.
↧