Sunday, November 15, 2015

Outputing to a variable and text file

Outputing to a text file which is written to the root of the current userprofile.

get-appvclientconfiguration -outvariable vname 
$vname | Out-File vname.txt


Out-File is often useful but is usually quite frustrating without the -width x parameter added.  By default it restricts the width of the outputed lines to the same as the console which is 80 characters in a default console window.  The result is that lines are truncated with ... added where they are longer.  Override the problem but setting a larger width value.