Skip to content
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

Loading temporary ExtensionService script causes error loop when execution policy locked to AllSigned #784

Closed
domhnal opened this issue May 25, 2017 · 1 comment
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@domhnal
Copy link

domhnal commented May 25, 2017

System Details

  • Operating system name and version: Windows 10 Pro v1607
  • VS Code version: 1.12.2
  • PowerShell extension version: 1.1.0
  • Output from $PSVersionTable:
    Name Value

PSVersion 5.1.14393.1066
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.1066
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here
+ code -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\brucemacdonald> $pseditor.EditorServicesVersion


Major  Minor  Build  Revision
-----  -----  -----  --------
1      1      0      0


PS C:\Users\brucemacdonald> code --list-extensions --show-versions

code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ code --list-extensions --show-versions
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\brucemacdonald> $PSVersionTable


Name                           Value
----                           -----
PSVersion                      5.1.14393.1066
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.1066
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
 

Issue Description

Domain enforced execution policy of AllSigned still causing problems. The PowerShell Editor Services module, specifically the ExtensionService, is writing PS script to files in the temp folder prior to execution, rather than executing it directly, to avoid creating a lot of noise in the logs (according to source comments). However, the execution of the files fails because they are not signed.

Attached Logs

1495713868-7e829c45-df99-45e5-8a0b-b66def66d6361495713858270.zip

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

@daviwil
Copy link
Contributor

daviwil commented May 25, 2017

Weird... Not sure why the error keeps getting written repeatedly, looks like it's getting stuck in a loop. Will investigate!

@daviwil daviwil added this to the 1.2.0 milestone May 25, 2017
@daviwil daviwil changed the title Enforced execution policy still causing problems Loading temporary ExtensionService script causes error loop when execution policy locked to AllSigned May 25, 2017
@daviwil daviwil modified the milestones: 1.3.0, 1.2.0, June 2017 May 30, 2017
daviwil added a commit to daviwil/PowerShellEditorServices that referenced this issue Jun 3, 2017
This change adds a new PowerShellEditorServices.Commands module that
gets loaded inside of the editor session's runspace to provide functions
and cmdlets which are useful when working with the $psEditor APIs.  This
will also be the place where built-in "editor commands" are registered
when the session initializes.

Resolves PowerShell#403.
Resolves PowerShell/vscode-powershell#784.
daviwil added a commit to daviwil/PowerShellEditorServices that referenced this issue Jun 3, 2017
This change adds a new PowerShellEditorServices.Commands module that
gets loaded inside of the editor session's runspace to provide functions
and cmdlets which are useful when working with the $psEditor APIs.  This
will also be the place where built-in "editor commands" are registered
when the session initializes.

Resolves PowerShell#403.
Resolves PowerShell/vscode-powershell#784.
daviwil added a commit to PowerShell/PowerShellEditorServices that referenced this issue Jun 3, 2017
This change adds a new PowerShellEditorServices.Commands module that
gets loaded inside of the editor session's runspace to provide functions
and cmdlets which are useful when working with the $psEditor APIs.  This
will also be the place where built-in "editor commands" are registered
when the session initializes.

Resolves #403.
Resolves PowerShell/vscode-powershell#784.
@daviwil daviwil modified the milestones: June 2017, 1.3.0 Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

2 participants