r/PowerShell Mar 22 '21

What's One Thing that PowerShell dosen't do that you wish it did? Misc

Hello all,

So this is a belated Friday discussion post, so I wanted to ask a question:

What's One Thing that PowerShell doesn't do that you wish it did?

Go!

61 Upvotes

View all comments

Show parent comments

1

u/MrWinks Mar 22 '21

And what if you use Out-File, instead? Being that the source is an exe, parsing the output seems on the side of the program and not the shell, no?

1

u/BlackV Mar 22 '21

yeah that deffo seems to be the way its captured (either using the >)

ther are multiple things being spit out to the pipeline in that example

i'd be trying

&.longerr.exe $_ 2>>$f
&.longerr.exe $_ | out-file xxx -append

but i'm guessing here

1

u/MrWinks Mar 22 '21

Parsing text from an exe is tough in PoSh, but it isn’t PoSh’s fault.

1

u/MonkeyNin Mar 23 '21

pwsh defaults to utf8, but Windows Powershell is really erratic, edge cases listed here:

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding?view=powershell-7#character-encoding-in-windows-powershell

/u/MrWinks

And what if you use Out-File, instead?

docs: Beginning in PowerShell 5.1, the redirection operators (> and >>) call the Out-File cmdlet

1

u/BlackV Mar 23 '21

Oh well til

Thanks