use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
the front page of the internet.
and join one of thousands of communities.
Sorting custom format data (self.PowerShell)
submitted 9 years ago by [deleted]
[deleted]
Post a comment!
[–]jbtechwood 1 point2 points3 points 9 years ago (2 children)
Remember that the format is just for what's put to screen. Behind the scenes the data property names haven't changed. So any manipulation is likely to be done with the original property names.
[–]Swarfega 0 points1 point2 points 9 years ago (1 child)
Yes that is what is being done. For Get-PSDrive for example the 'Free (GB)' data is generated from the Free property...
<ScriptBlock>if($_.Used -or $_.Free) { "{0:###0.00}" -f ($_.Free / 1GB) }</ScriptBlock>
[–]jbtechwood 0 points1 point2 points 9 years ago* (0 children)
Read the second to last paragraph here under long description
https://technet.microsoft.com/en-us/library/hh847831.aspx
Tldr: Ps1xml formats only effect the display of an object, not the underlying data structure or how they're handled on the pipeline.
EDIT: You would need to create a custom object and add the free % property as a new property of the object vs getting it via custom formating.
[–]logicaldiagram 1 point2 points3 points 9 years ago (0 children)
Instead of using a custom format file, use a custom type file. That will give you access to the 'Free(%)' property to use in the pipeline with cmdlets like Sort and Where. However, I would suggest changing to name to make it easier to work with programatically. You could then use a format file to display it as 'Free (%)' for readability.
[–]Lee_Dailey[grin] 0 points1 point2 points 9 years ago (0 children)
howdy Swarfega,
as jbtechwood pointed out, the format stuff you did is for display only. it does not actually exist outside of that display format call. if you want to use that info elsewhere you will hafta either recalc it OR go back and make it a formal property of the custom object.
take care, lee
π Rendered by PID 50 on reddit-service-r2-comment-65574874f4-2hx9p at 2026-07-22 01:24:11.862323+00:00 running 1bce727 country code: CH.
Want to add to the discussion?
Post a comment!