get-command where {$_.name -like "get-sp*"}
It works, but would it be nice to have this defined as an alias as I need to run it very often. Sure you can do this by using set-alias cmdlet, but it won;t survive another session, in other words, after you close powershell, it is gone.
the workaround is to define a function or alias in profile:
- Open Powershell ISE from Programs>Accessories>PowerShell folder
- Run the following code from the immediate window in ISE to create a new profile for all users
- Run the following code to edit the new profile
- When profile1.ps1 opens, add the following code:
- save and exit ISE
- relaunch ISE and type "getspcmd"