header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Another Formatting Question/error
Last Post 22 Sep 2008 12:45 AM by halr9000. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
SynJunkieUser is Offline
New Member
New Member
Posts:97
Avatar

--
21 Sep 2008 09:34 PM  

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

 

ShayUser is Online
Basic Member
Basic Member
Posts:281
Avatar

--
21 Sep 2008 10:17 PM  
It's a bug:
https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=152205&SiteID=99
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
SynJunkieUser is Offline
New Member
New Member
Posts:97
Avatar

--
21 Sep 2008 10:24 PM  
Thanks Shay. I'll try and figure out a workaround.
halr9000User is Offline
PowerShell MVP, Site Admin
Basic Member
Basic Member
Posts:335
Avatar

--
22 Sep 2008 12:45 AM  
You can probably get around this by inserting or appending an "out-default". I've run into this before and that helped.
Community Director, PowerShellCommunity.org
Co-host, PowerScripting Podcast
Author, TechProsaic
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer