ValidateSet in JEA

Welcome Forums DSC (Desired State Configuration) ValidateSet in JEA

This topic contains 3 replies, has 3 voices, and was last updated by

1 year, 3 months ago.

  • Author
  • #83522

    Points: 2
    Rank: Member

    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?


  • #83527

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    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.

  • #83530

    Points: 0
    Rank: Member

    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.

  • #83537

    Points: 2
    Rank: Member

    Ok, bummer.

    Thanks for the quick response guys, much appreciated!

The topic ‘ValidateSet in JEA’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort