# Format Conflict - dir function:

**URL:** <https://forums.powershell.org/t/format-conflict-dir-function/125>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/format-conflict-dir-function/125 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/format-conflict-dir-function/125/1 "2011-12-31T18:30:00Z")

</div>

by thnk2wn at 2012-09-03 21:57:22

> When I run the below code (I changed the assembly name for ease of running/reproduction) :  
>   
> `function Get-MyAssembly{ [appdomain]::currentdomain.getassemblies() <br> | where-object {$_&#46;FullName -like 'System&#46;Data, *'} | select-object -first 1}function Select-MyAssemblyTypes{ $asm = Get-MyAssembly $asm.GetTypes() | Where-Object {$.IsPublic} | Sort-Object {$.FullName }}dir function:Select-MyAssemblyTypes | Where-Object {$.Name -like ‘DataTable*’} | ft`  
>   
> _…I receive the error:  
> 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_  
>   
> _If I remove the "dir function:" or pipe that to Out-Default as below, the problem goes away. Can someone explain this behavior to me? I can live with Out-Default but I don’t understand why this issue happened and it took a while to narrow it down to "dir function:" being the problem. I am seeing some posts about potential bugs around this type of behavior so maybe it’s just an issue in PowerShell V2? One such post is: http://81stperson.blogspot.com/2011/09/powershell-gotcha-kink-in-powershell.html_  
>   
> _`function Get-MyAssembly{ [appdomain]::currentdomain.getassemblies() <br> | where-object {$_&#46;FullName -like 'System&#46;Data, *'} | select-object -first 1}function Select-MyAssemblyTypes{ $asm = Get-MyAssembly $asm.GetTypes() | Where-Object {$`_`.IsPublic} | Sort-Object {$.FullName }}dir function: | Out-DefaultSelect-MyAssemblyTypes | Where-Object {$.Name -like ‘DataTable*’} | ft`

by RichardSiddaway at 2012-09-04 03:26:08

> try   
>   
> dir function: | ft  
>   
> Its a common problem when you output two different objects  
>   
> explicitly formatting usually sorts it

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:02pm UTC](https://forums.powershell.org/t/format-conflict-dir-function/125/2 "2024-05-16T21:02:38Z")

</div>

Closed on May 16, 2024, 9:02pm UTC


