I have multiple services. Suppose i starts with A . When I execute
Get-Service A* - It will display services as output starting with A.
I am sorting complete output except one and want that to be on top of my list once sorted. I am using below command.
Get-Service -DisplayName A* |Sort-Object {$_.Name -ne 'AK'}
It is listing all output in sorted way and AK is on top Like below .
AK
AN
AR
AS
and so on . This is only keeping AK on top and sorting others. I want to do same thing for 2 services. AK and then AR(suppose)- This both should be always in AK and AR order at top then other services need to sort. How to add this in existing code for AR.