New
#21
Yes, at end, run
Sort-object using the property value you want to sort on and then you can sort ascending or descending.
Yes, at end, run
Sort-object using the property value you want to sort on and then you can sort ascending or descending.
I've tried to use Sort-Object but no success. Can you include it in the sample code?
$array=get-process |where-object {$_.ProcessName -Match "svchost"}|Select Id
foreach ($item in $array.Id){
Get-WmiObject -Class win32_service -Filter "ProcessID='$item'" | select DisplayName
}
Out-gridview would do it although there is a more elegant way I'm sure.
Code:$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 | out-gridview
Perhaps this may explain why my limited 4gig of RAM laptop now seems slightly more sluggish after the update. Yes, It seemed sluggish before, but now...
Anyway this is why I tell people I see absolutely NO reason to stick with less than 8, or even 16 gig of RAM. Both my desktops run 32gig. But my Asus Zenbook Prime UX31A laptop is locked at 4gig by design
I always recommend 8. Haven't had less than 8 for many years. 16 is good for vms. I have not yet taken a home machine over 16GB.
As a photographer who processes large image files (typically 800mb to 1gig) in Photoshop, I find 32gig works well for me. And for me, I've not been with less 8 for many years as well.
When I bough my notebook I knew it was RAM limited but I figured I could work with it seeing I don't game on it. Now it chokes whenever I try to process RAW files through LR from my Nikon D800E. Being a 36 megapixel camera it produces 73meg nef files. You can bet my next notebook won't be so RAM limited.
Anyway with Windows 10, anyone running 4gig of RAM on a 64-bit OS is in for a sluggish ride. I know, I'm there with my notebook
...you're right: I've tried different combinations with no avail...
EDIT: Try this one and tell me if it's what you're looking for...
Get-WmiObject -Class win32_service | Select DisplayName | Sort DisplayName
EDIT2:
$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
...maybe I did not understand the problem...
$array=get-process |where-object {$_.ProcessName -Match "svchost"}|Select Id
foreach ($item in $array.Id){Get-WmiObject -Class win32_service -Filter "ProcessID='$item'" | select DisplayName | Sort-Object DisplayName}
The parts I edited are in bold, orange, it was simply putting
| Sort-Object DisplayName