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

ps-win.ps1 errors when running code --status #46963

Closed
Tyriar opened this issue Mar 29, 2018 · 6 comments
Closed

ps-win.ps1 errors when running code --status #46963

Tyriar opened this issue Mar 29, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded windows VS Code on Windows issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Mar 29, 2018

Extracted from #43169 (comment)

Collecting CPU and memory information. This might take a couple of seconds.
[main 3:39:47 PM] Error: Get-WmiObject : Invalid class "Win32_Process"
At C:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\base\node\ps-win.ps1:114 char:19
+ foreach ($item in Get-WmiObject Win32_Process -Filter "name = '$ProcessName'") {
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCom
   mand

Get-WmiObject : Invalid class "Win32_Process"
At C:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\base\node\ps-win.ps1:117 char:19
+ foreach ($item in Get-WmiObject Win32_Process -Filter "name = 'codeHelper.exe'") ...
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCom
   mand

Get-WmiObject : Invalid class "Win32_Process"
At C:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\base\node\ps-win.ps1:121 char:19
+ foreach ($item in Get-WmiObject Win32_Process -Filter "name Like '%'") {
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [Get-WmiObject], ManagementException
    + FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCom
   mand


    at ChildProcess.<anonymous> (C:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\code\electron-main
\main.js:157:375)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)

It might make sense to transition to windows-process-tree v0.2.0 instead of fixing this. /cc @RMacfarlane

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug windows VS Code on Windows issues labels Mar 29, 2018
@Tyriar Tyriar changed the title ps-win.ps1 errors when running code-status ps-win.ps1 errors when running code --status Mar 29, 2018
@dbaeumer
Copy link
Member

dbaeumer commented Apr 3, 2018

@RMacfarlane does windows-process-tree offer CPU information as well ?

@Tyriar
Copy link
Member Author

Tyriar commented Apr 3, 2018

@RMacfarlane
Copy link
Contributor

@dbaeumer @Tyriar I also have #46433 tracking this as I want to reuse this same code path in the process explorer. I went ahead and made a PR for the change, @dbaeumer it would be great if you could take a look: #47152

The only issue I've run into with the windows-process-tree module so far is that the length limit on the commandLine property, 512 chars, sometimes results in the ends of arguments getting cut off for extHost processes. This throws off matching to calculate a better display name:
image

microsoft/vscode-windows-process-tree#23 is tracking that

@dbaeumer dbaeumer added this to the April 2018 milestone Apr 3, 2018
@dbaeumer
Copy link
Member

dbaeumer commented Apr 3, 2018

@RMacfarlane thanks a lot for providing the PR. I will have a look!

@RMacfarlane
Copy link
Contributor

I updated the windows-process-tree module to have a length limit of 4096 for commandLine, have now merged in the changes to use it when listing processes, 6b62365

@dbaeumer
Copy link
Member

dbaeumer commented Apr 9, 2018

@RMacfarlane +1 for merging that in.

@RMacfarlane RMacfarlane added *not-reproducible Issue cannot be reproduced by VS Code Team member as described verified Verification succeeded and removed *not-reproducible Issue cannot be reproduced by VS Code Team member as described labels Apr 26, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded windows VS Code on Windows issues
Projects
None yet
Development

No branches or pull requests

3 participants