Fix Invoke-Command missing error on session termination.
#11586
+31
−7
Merged