Skip to content

Extension should notify user when Constrained or Restricted language mode is enabled #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Sep 10, 2016 · 5 comments
Labels
Issue-Enhancement A feature request (enhancement).

Comments

@ghost
Copy link

ghost commented Sep 10, 2016

Please fill in these details so that we can help you!

System Details

  • Operating system name and version: Windows 10 Enterprise 64-bit (1607)
  • VS Code version: 1.5.1
  • PowerShell extension version: 0.7.2
  • Output from $PSVersionTable:
Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.14393.103                                                                           
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.14393.103                                                                          
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 

Issue Description

Everytime when I open any PS script with VS Code and PS extension installed I get these errors:

Error: Could not start language service: undefined
Error: Couldn't start client PowerShell Editor Services

1473484659-PowerShell.zip

Attached Logs

Follow the instructions in the README
about capturing and sending logs.

@ghost ghost changed the title Errors whe Errors whit PS extension Sep 10, 2016
@daviwil
Copy link
Contributor

daviwil commented Sep 12, 2016

Hi @z442a9, it appears that your machine must have some policy set which enabled ConstrainedLanguage mode. This is preventing the language service from loading successfully.

Open a normal PowerShell prompt and run this line and let me know if the output is ConstrainedLanguage or RestrictedLanguage:

$ExecutionContext.SessionState.LanguageMode

You may have to talk to your administrator to see if this can be turned off for the PowerShell extension to work correctly. I'll add a warning message in the UI to notify the user that the extension won't work when this mode is turned on.

@daviwil daviwil changed the title Errors whit PS extension Extension should notify user when Constrained or Restricted language mode is enabled Sep 12, 2016
@daviwil daviwil added this to the Backlog milestone Sep 12, 2016
@daviwil daviwil added the Issue-Enhancement A feature request (enhancement). label Sep 12, 2016
@ghost
Copy link
Author

ghost commented Sep 13, 2016

Hi

When I run the command the output is: ConstrainedLanguage

@TylerLeonhardt TylerLeonhardt modified the milestone: Future May 24, 2018
@caparkaya
Copy link

Hello,
I see that this issue is still open but notification is already here for a long time for me in VS Code. Isn't it time to move to next step, i.e. removing the need for the message by supporting constrained mode like Powershell ISE does?

@rjmholt
Copy link
Contributor

rjmholt commented Jul 18, 2018

Because we're not a native app (like the ISE), but instead a client/server, with the server being a PowerShell process running a module that hosts PowerShell execution, I suspect trying to implement this we'd have widespread problems with things like the whitelisted types (i.e. EditorServices is just an ordinary PowerShell module which uses non-whitelisted types for everything from just starting the host to creating the message transport channel, so getting it to start in ConstrainedLanguage mode would be a significant work item).

I'll see if I can do some investigating on the feasibility of this.

@TylerLeonhardt
Copy link
Member

Closing this in favor of #754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

4 participants