Hi
Is there any reason why I can use the following line direct from powershell but not in a script?
gwmi win32_service -ComputerName $victim | select ProcessID,Name,DisplayName,StartMode,State,PathName | sort StartMode | ft -AutoSize
I'm writing a Incident Response script to replace a batch file that must be run locally and all I want to do is create a text file of result of a few WMI queries to run on a remote host.
The error I get is:
out-lineoutput : Object of type "Microsoft.PowerShell.Commands.Internal.Format.
FormatStartData" is not legal or not in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with the default formatting.
Any help would be appreciated.
Lee