Powershell – Truth about default formatting


cmdlet의 default output format에 대하여 자세히 설명되어 있다.
Get-Process, Get-Service, Get-WmiObject의 출력 형식이 다른 이유에 대한 내용이 기술되어 있다.

Explore Azure and Powershell

Have you ever ran a powershell cmdlet and stare at the output, and ever wondered, what makes Powershell display the results in such a way? Is there any hidden configuration that guides the powershell engine to display results in a specific format for one cmdlet and in a different format for another cmdlet??

Read along. This blog will answer your curiosity !

Example: Below is the output of Get-service

get-service

Below is the output of Get-Process

get-process

The answer is Yes. The Powershell Engine is indeed guided by a configuration file that tells powershell on how to display the results. Or we call it as the “Default rules for Formatting” (not an official name :))

You will find the configuration files in the Powershell Installation Folder. Use the “$pshome” variable to find out the Powershell Installation Folder.

PS E:WorkPowershellscripts> $pshome
C:WindowsSystem32WindowsPowerShellv1.0

Change the directory to the Powershell Installation directory and you must be…

View original post 646 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s