Enable tab completion using restricted PowerShell endpoint

Understand PowerShell tab completion with restricted endpoints.

John Savill

April 8, 2017

1 Min Read
Enable tab completion using restricted PowerShell endpoint

Q. How do I enable tab completion when using a restricted custom PowerShell endpoint?

A. When using a constrained endpoint in PowerShell you may find autocomplete does not work. This is because the tab complete is actually enabled via a function called Function:TabExpansion2 which is not available. To fix simple may the function available in the constrained endpoint via the VisibleFunctions parameter, for example:

New-PSSessionConfigurationFile –ModulesToImport OneMOD, ActiveDirectory `  -VisibleCmdLets ('*OneMOD*','*AD*') `  -VisibleFunctions ('TabExpansion2') -VisibleAliases ('exit') –LanguageMode 'ConstrainedLanguage' `  -SessionType 'RestrictedRemoteServer' –Path 'c:onemodonly.pssc'

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like