Windows 10: Creators Update: number of processes Solved

Page 4 of 4 FirstFirst ... 234

  1. Posts : 5,684
    Windows 10 Pro X64 16299.192
       11 Apr 2017 #31

    Doesn't work, get the same result with or without Sort-Object.
      My ComputersSystem Spec

  2.    11 Apr 2017 #32

    There's a way to regroup the services as per the tutorial below from the Winaero site

    Set Split Threshold for Svchost in Windows 10 - Winaero
      My ComputerSystem Spec

  3.    12 Apr 2017 #33

    Ztruker said: View Post
    Doesn't work, get the same result with or without Sort-Object.
    It's strange but this works for me:

    $array=get-process |where-object {$_.ProcessName -Match "svchost"}|Select Id
    $names=foreach($item in $array.Id){
    Get-WmiObject -Class win32_service -Filter "ProcessID='$item'" | select DisplayName
    }
    $names | sort-object DisplayName
      My ComputerSystem Spec


  4. Posts : 5,684
    Windows 10 Pro X64 16299.192
       12 Apr 2017 #34

    JoeMcLutz said: View Post
    It's strange but this works for me:

    $array=get-process |where-object {$_.ProcessName -Match "svchost"}|Select Id
    $names=foreach($item in $array.Id){
    Get-WmiObject -Class win32_service -Filter "ProcessID='$item'" | select DisplayName
    }
    $names | sort-object DisplayName
    Yes, that works perfectly for me as well, many thanks.
      My ComputersSystem Spec

  5.    13 Apr 2017 #35

    Ztruker said: View Post
    Yes, that works perfectly for me as well, many thanks.
    Ooh! Fine! You're welcome: I'm happy for you!
      My ComputerSystem Spec

  6.    13 Apr 2017 #36

    Ztruker said: View Post
    Doesn't work, get the same result with or without Sort-Object.
    That is because the |sort-object is within the foreach loop. So each time it is sorting 1 thing.

    It is saying for every process (sorted by Id ), I'm going to find its name using Get-WmiObject. Then I'll sort that (one specific) DispayName.

    Obviously the results will be the same as you are still sorting by Id even though you have then further sorted the DispayName for the Id (which is unique anyway).

    Another method is to put all the results from the foreach loop into another array (for example $names).

    This appears slower because rather than writing out one line at a time to the console it does them all. It isn't slower btw just doesn't keep you updated.

    You can then sort $names by DisplayName rather than Id as it then has the information it wants to sort by.

    Or indeed output $names with or without sorting toOut-GridView and sort using the GUI.

    I've been idly thinking about it but haven't come up with a more elegant solution. More of a StackOverflow question though really...
    Last edited by lx07; 13 Apr 2017 at 05:44.
      My ComputerSystem Spec


  7. Posts : 5,684
    Windows 10 Pro X64 16299.192
       13 Apr 2017 #37

    lx07 said: View Post
    Or indeed output $names with or without sorting to Out-GridView and sort using the GUI.
    Using the GUI to sort is a nice idea. Works well too. Thank you.
      My ComputersSystem Spec


 
Page 4 of 4 FirstFirst ... 234

Related Threads
It's dejŠ vu all over again. :doh: The correct behaviour of windows update over a metered connection is to offer the choice to download, or wait until on a non-metered connection. 128460 The initial build of the Anniversary Update broke...
:arrow: Windows 10 Creators Update version 1703 (build 15063) now available from Windows 10 Update Assistant. See also: Managing Windows 10 Creators Update rollout for a seamless experience - - Windows 10 Forums Windows 10 Creators Update...
Source: Windows 10 Creators Update and Creators Update SDK are Released - Building Apps for WindowsBuilding Apps for Windows :arrow: Windows 10 Creators Update version 1703 (build 15063) now available from Windows 10 Update Assistant. ...
Source: https://blogs.msdn.microsoft.com/visualstudio/2017/03/16/visual-studio-2017-update-preview-and-windows-10-creators-update-sdk/
I notice that many updates occur automatically. With small updates I don't even know they have occurred. I always try to make a restore point before a big update actually updates my comp. (for obvious reasons) and I am sometime given notice, often...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:31.
Find Us