Wednesday, 19 August 2020

PowerShell Truncating Output

I've been trying to figure out the patch level of a server using PowerShell but the output is getting truncated:

 

So the output is only partially useful.

As a bit of Googling I found https://mcsaguru.com/how-to-fix-truncated-powershell-output/

To quote his useful resource...

Let’s fix Truncated PowerShell Output by setting up the value of a variable called “FormatEnumerationLimit

By default, the value of this variable is equal to 4. It’s mean it will only show the first four items in the array, and remaining values in the result will get truncated. To get all the values we have to set the value of this variable to -1."

So I entered:

$FormatEnumerationLimit = -1 

And ran the command again, the output is now:

No comments:

Post a comment