Start Menu Search using PowerShell
Searching for programs to run from Start Menu is tedious which lead me to write a
IronPython script for it.
Tonight, I learned
PowerShell and here is what I have so far which does the same thing:-
cd to your '\All Users\Start Menu' directory
to search for all programs with the 'sql' in its name, type
$hits = ls -recurse -filter *.lnk | where {$_.Fullname -like "*sql*"}this will display the result of the search
echo $hits | select Nameto start the 1st hit in the result, type
ii $hits[0].PSPaththat's it!! this will run the program which is first in the list.
Sample run :-
Objective: To start Visual C# Express IDE
PS C:\Documents and Settings\All Users\Start Menu> $hits = ls -recurse -filter *.lnk | where {$_.Fullname -like "*express*"}
PS C:\Documents and Settings\All Users\Start Menu> echo $hits | select Name
Name
----
Microsoft Visual C# 2005 Express Edition.lnk
Microsoft Visual Web Developer 2005 Express Edition.lnk
SQL Server Management Studio Express.lnk
PS C:\Documents and Settings\All Users\Start Menu> ii $hits[0].PSPath