Powershell Format-Table HELL!

#Powershell

This really is killing me, I am getting it more an more.

Basically if I create an array I want to send the output to the screen using Format-Table.

In the shell it works fine, but when I use a .ps1 I am constantly getting

out-lineoutput : The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-table" command which is conflicting with the
default formatting.
+ CategoryInfo : InvalidData: (:) [out-lineoutput], InvalidOperationException
+ FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand

What the hell is going on?! Why is the shell different to a .ps1

I don’t want a list, all I want is a table! .. Select-Object can’t make up its mind if it want to use a table or list and I done see anyway around it .. Event exporting to CSV and reimporting fails!

2 thoughts on “Powershell Format-Table HELL!

Leave a Reply to Jan Egil Ring Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.