Author Posts

November 2, 2017 at 8:48 pm

I've just setup my first JEA end point, and set VisibleCmdLets to do a ValidateSet for Restart-Service:
VisibleCmdlets = @{ Name = 'Restart-Service'; Parameters = @{ Name = 'Name'; ValidateSet = 'BITS', 'W3SVC'}},

I found that to be able to do Tab Completion in JEA, I need to do Implicit Remoting, which works fine. However if I try to tab complete the name parameter to see BITS or W3SVC, those don't return, and instead it starts enumerating files from my local computer (not the JEA end point).

Does anyone know if it's possible with the implicit remoting to tab through the ValidateSet values?

Thanks,
Jerame

November 2, 2017 at 9:46 pm

Implicit remoting is more complex. The tab completion would have to work *locally*, because the command isn't sending back-and-forth to the remote machine to do that. Additionally, if the remote endpoint doesn't provide, say, Get-Service, then there'd be no way to tab complete.

November 2, 2017 at 10:15 pm

This behavior is expected. Tab Completion works by calling a function called TabExpansion2 which is disallowed by default for JEA because it in turn will call other tab completer implementations which JEA cannot ensure is safe. Best practice for interactive use of JEA is to use it via implicit remoting. Non-interactive use can use JEA directly over PSRP.

November 2, 2017 at 10:58 pm

Ok, bummer.

Thanks for the quick response guys, much appreciated!