I have below content in a txt file which will be read by powershell and should be rearranged based on a custom condition
File: abc.txt
General
User1/Alert
User1/LogicApp
General/Abc
User2/Alert
User2/LogicApp
Above should be sorted with custom condition where if "General" exists, it should be on top of the list and if string "LogicApp" exists, it should be next to General. Hence, output should be something like below
General
General/abc
User1/LogicApp
User2/LogicApp
User1/Alert
User2/Alert
If string "General" doesn't exist, then string "LogicApp" should be taking priority. Can we do this custom sorting in Powershell ?