MicroNugget: How to Sort and Format PowerShell Output

preview_player
Показать описание

In this video, Jacob Moran covers various PowerShell commandlets that are the workhorses of Microsoft’s command-line shell. When used improperly, these can create all sorts of unusable outputs. Jacob will guide you through the use of various format commandlets, as well as sort-object, to ensure the outputs you generate are stable and usable.

Microsoft’s PowerShell uses commandlets to employ many of its powerful functions, but these aren’t necessarily intuitive. When used correctly, they open up a whole new world of possibilities. If you apply them incorrectly, however, you’ll generate a host of unusable outputs.

Several of the commandlets Jacob will discuss include:

• Get-Process | Format-Wide
• Get-Process | Format-Wide -Column
• Get-Process | FL
• Get-Process | FL name cpu, StartTime

When you put in the effort on the front end to set PowerShell commandlets up correctly, you’ll get results that are sorted, grouped, and formatted in such a way that you can quickly find what you’re looking for. This also makes it easier for other users to view and use our scripts.

Start learning with CBT Nuggets:

Рекомендации по теме
Комментарии
Автор

How to save the whole text present on the PowerShell screen not just after the single command?

Автор

how would I sort the output of the directory with a single line and then redirect the final sorted output to a new file

MemoirsOfADrainCleaner