This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| This might help in finding that pesky windows service that's always locking you out when you change your password and reboot. | |
| #> | |
| # ft is Format-Table; -auto is auto column width; -wrap is wrap text if necessary | |
| Get-WmiObject win32_service | sort startname,startmode,state,displayname | select StartMode,State,StartName,DisplayName | ft -auto -wrap | |
| # Or you can select only certain services. | |
| # '?' is 'where' alias; -match uses regular expressions; -not is (obviously) a 'not' operator. | |
| Get-WmiObject win32_service | ? {-not ($_.state -match 'running')} | sort startname,displayname | select StartMode,State,StartName,DisplayName | ft -auto -wrap |