We have encountered issues at work with SSH Server software and are looking at switching to WinRM for remote management via PowerShell.
There's a catch, however, and it's something I didn't expect.
If I tunnel to a remote server via SSH, then launch a command-line program like WinSCP.com, my console switches from the shell prompt to the WinSCP prompt and my user experience becomes virtually indistinguishable from what I'd get if I had connected via remote desktop and then launched the program "directly". This is good. This is what I wanted, what I expected, and what makes my life easy.
If I tunnel to that same remove server via WinRM, then launch that same program, my PowerShell console displays the greeting text and the WinSCP prompt, then closes WinSCP and presents me with the session prompt. For some reason, no such program will remain "active" in that environment.
What I want:
Code:
PS E:\> Enter-PSSession Remote-Computer
[Remote-Computer]: PS C:\Users\Shelgeyr\Documents> & "C:\Program Files (x86)\WinSCP\WinSCP.com"
[Remote-Computer]: winscp>
What I get:
Code:
PS E:\> Enter-PSSession Remote-Computer
[Remote-Computer]: PS C:\Users\Shelgeyr\Documents> & "C:\Program Files (x86)\WinSCP\WinSCP.com"
[Remote-Computer]: winscp>
[Remote-Computer]: PS C:\Users\Shelgeyr\Documents>
Thankfully,
WinSCP has published a .NET Assembly which allows me to work around this behavior.
Unfortunately, the same thing happens with Connect:Direct, and they have not published a .NET Assembly.
So when I attempt to use Connect:Direct via WinRM, I get this:
Code:
PS E:\> Enter-PSSession Remote-Computer
[Remote-Computer]: PS C:\Users\Shelgeyr\Documents> & "D:\Program Files (x86)\Sterling Commerce\Connect Direct v4.6.00\Common Utilities\Direct.exe"
8/11/2014 11:30:17 AM: Connect:Direct Command Line Interface Version 4.6.00 Build 019
(C) Copyright IBM Corp. 1983, 2011 All Rights Reserved.
*************************************************
Successfully connected to Connect_Direct_Node
Successfully disconnected from Connect_Direct_Node
[Remote-Computer]: PS C:\Users\Shelgeyr\Documents>
I'm busy working to discover a way to get around this, and am tempted to write my own damn .NET Assembly for in-house use, but I'm dying to know why WinRM can't seem to launch a usable, interactive session with a command-line application.
Anybody have insight?