Skip to content

Extension should support running in constrained language mode #606

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
daviwil opened this issue Mar 23, 2017 · 14 comments
Closed

Extension should support running in constrained language mode #606

daviwil opened this issue Mar 23, 2017 · 14 comments
Labels
Area-Startup Issue-Enhancement A feature request (enhancement).

Comments

@daviwil
Copy link
Contributor

daviwil commented Mar 23, 2017

Right now we show an error message on startup of constrained language mode is turned on via AppLocker policy. We should do the necessary work to make the extension operate at some level with this mode turned on. The PowerShell ISE supports it.

@daviwil daviwil added the Issue-Enhancement A feature request (enhancement). label Mar 23, 2017
@daviwil daviwil modified the milestones: 1.0, 1.0.0, 1.0.0-beta1 Mar 23, 2017
@daviwil daviwil modified the milestones: 1.0.0-beta1, June 2017 May 8, 2017
@daviwil daviwil modified the milestones: June 2017, July 2017 Jul 11, 2017
@daviwil daviwil modified the milestones: July 2017, Future Oct 26, 2017
@TylerLeonhardt TylerLeonhardt modified the milestone: Future May 24, 2018
@caparkaya
Copy link

Hello, is there an established roadmap, plan for this?

@TylerLeonhardt
Copy link
Member

Closing this in favor of #754

@rjmholt
Copy link
Contributor

rjmholt commented Nov 27, 2019

I'm doing work now to move PSES over to a binary module to make this easier, but it looks like there are still issues because of how PSReadLine works. I'm not sure if those are the only issues, but that's the current blocker; we invoke a PSReadLine static method in PowerShell script directly for the prompt. So to enable constrained language mode, that's the next issue to solve.

@rjmholt
Copy link
Contributor

rjmholt commented Dec 12, 2019

Another facet here is that we have dependencies that aren't signed:

> ls .\module\PowerShellEditorServices\bin\Common\ | Get-AuthenticodeSignature | ? Status -eq 'NotSigned' | ft Status,Path

   Status Path
   ------ ----
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\MediatR.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\MediatR.Extensions.Microsoft.DependencyInjectio…
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Microsoft.PowerShell.EditorServices.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Newtonsoft.Json.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.DebugAdapter.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.DebugAdapter.Server.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.JsonRpc.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.LanguageProtocol.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\OmniSharp.Extensions.LanguageServer.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Serilog.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Serilog.Extensions.Logging.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Serilog.Sinks.Async.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Serilog.Sinks.Console.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\Serilog.Sinks.File.dll
NotSigned C:\Users\roholt\Documents\Dev\PowerShellEditorServices\module\PowerShellEditorServices\bin\Common\UnixConsoleEcho.dll

@TylerLeonhardt
Copy link
Member

@rjmholt I believe there's a way for us to sign things as "external deps" but need to do the research.

@romero126
Copy link

Has there been any additional update on this? I am fairly interested in a desirable outcome from this.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jan 21, 2020
@SydneyhSmith SydneyhSmith added Area-Startup and removed Needs: Maintainer Attention Maintainer attention needed! labels Jan 21, 2020
@TylerLeonhardt
Copy link
Member

We talked offline but to capture it here as well...

First comment out this line so you can actually test this:
https://github.com/PowerShell/PowerShellEditorServices/blob/d8fc936bea002b897046e6e4952ae2c837216aa8/src/PowerShellEditorServices.Hosting/EditorServicesLoader.cs#L190

Then see where it breaks with ConstrainedLanguage mode turned on...

Here is a good list to start:​​​​
image

These are hits for ]:: in PowerShellEditorServices. Any method invocations will have to either be done a different way, or wrapped in a binary cmdlet.

@dkattan
Copy link

dkattan commented Apr 16, 2020

Has anyone started working on this? I'd also love for this to work and can contribute if there is an existing branch.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Apr 16, 2020
@TylerLeonhardt
Copy link
Member

Hi @dkattan I don't think anyone is actively working on this. Are you interested in getting involved?

My steps in the comment above yours are still accurate. The way I'd approach this is:

  • uncomment the code I mention above
  • try to start up with constrainedlanguage mode
  • see what goes sideways and try to fix them

You're more than willing to drop any questions you have here.

Once start up works, we can get a PR out to support this... then we can start filling in what doesn't work (like the expand alias feature, remoting feature etc)

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Apr 21, 2020
@TylerLeonhardt
Copy link
Member

ConstrainedLanguage mode is now supported in the PowerShell Preview extension.

@craig-martin
Copy link

Exciting! This should allow us to use it on admin workstations where constrained language mode is enforced.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label May 3, 2020
@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label May 3, 2020
@nyannios
Copy link

Well add me to this too! The security gestapos have everything locked up here and I am getting this too
[ ](url
Untitled
)

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jul 18, 2020
@TylerLeonhardt
Copy link
Member

@nyannios what version of PowerShell are you using? The PowerShell extension only supports v5.1 and higher.

@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Jul 19, 2020
@nyannios
Copy link

Hey, I downloaded and installed PowerShell 7 for windows and now it's working! Thanks! I was on 4.0

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Jul 19, 2020
@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Startup Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

9 participants