Got it... For some reason it was not working for me.
Couple more questions:
- How do you install/start service ? I had to add self-installer to the service code (so it would install on "-install" from command line)
- Do you have an example on how to run powershell command and/or powershell script?
- Is there specific reason to use registry to get installation path? How about
string currentExeDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
- Under what account the service should run? "LocalSystem" appears to work fine, but service terminates after EVERY "dir" command that I execute (the command itself executes fine). Generates following log
2010-01-13 07:39:10,398  ERROR NSsh.Server.Service.Program - Unhandled exception in NSsh.
System.InvalidOperationException: Process was not started by this object, so requested information c
annot be determined.
at System.Diagnostics.Process.EnsureState(State state)
at NSsh.Server.ChannelLayer.Console.BaseProcessConsole.Close() in C:\Develop\NSsh\NSsh.Server\ChannelLayer\Console\BaseProcessConsole.cs:line 107
at NSsh.Server.ChannelLayer.BaseConsoleChannelConsumer.Close() in C:\Develop\NSsh\NSsh.Server\ChannelLayer\BaseConsoleChannelConsumer.cs:line 48
at NSsh.Server.ChannelLayer.Channel.<RequestReceived>b__3(Object s, EventArgs e) in C:\Develop\NSsh\NSsh.Server\ChannelLayer\Channel.cs:line 169
at NSsh.Server.TransportLayer.TransportLayerManager.Disconnect() in C:\Develop\NSsh\NSsh.Server\TransportLayer\TransportLayerManager.cs:line 180
at NSsh.Server.TransportLayer.TransportLayerManager.Disconnect(DisconnectReason reason) in C:\Develop\NSsh\NSsh.Server\TransportLayer\TransportLayerManager.cs:line 143
at NSsh.Server.SshSession.Process() in C:\Develop\NSsh\NSsh.Server\SshSession.cs:line 81 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)