You could definitely use full command names, instead of aliases, to make it a lot more readable.
I've not tested to see which is faster, but you've got Get-WinEvent, Get-EventLog (which you used), Get-CimInstance – all of which can access that same data. You'd need to test to see which was faster. Get-CimInstance, for example, could probably do all the filtering in one command, which means you wouldn't be enumerating as much.
The topic ‘Optimizing Command-Line’ is closed to new replies.