I am relatively new to PowerShell and couldn’t figure out how to shorten this command in “splat-style” shortening so it would read better, is there a way?
However, it’s generally better to put all of this logic right into your -Filter string, for performance reasons. In that case, you can’t use the array directly, but you can build up a filter string dynamically from the array. For example:
$exclude = "Software Protection", "Shell Hardware Detection", "Microsoft .NET Framework NGEN v4.0.30319_x86", "Microsoft .NET Framework NGEN v4.0.30319_x64"
$excludeAsString = @($exclude | ForEach-Object { "DisplayName != ""$_""" }) -join ' AND '
gwmi win32_service -ComputerName $servers -filter "StartMode = 'Auto' and State != 'Running' AND $excludeAsString" |
ft SystemName, DisplayName