PowerShell Parameters, Objects, and Formatting

PowerShell Tutorial 4: Using Cmdlet Options


Welcome back! Continuing with your PowerShell Training, the goal of this tutorial is to introduce PowerShell parameters, objects, and formatting output. I’m excited about this tutorial as we begin to define and discover the power of working with objects in PowerShell. By the end of this PowerShell training session you should have a good understanding of what an object is, how we gather information, and how changes are made in the environment.

Launch PowerShell and let’s get started…

Common Parameters (options for cmdlets)

As mentioned before, the standardization of the PowerShell syntax has reduced the learning curve. Cmdlets follow a standard “Verb-Noun” naming convention and also use common parameters. Note: not all cmdlets use these parameters. However, because the PowerShell engine interprets the parameter (not the cmdlet), each common parameter is enacted in the same fashion. Below is a list of the Common Parameters:

  • -whatif – Cmdlet is not actually executed, provides information about “what would happen” if executed.
  • -confirm - Prompt user before executing cmdlet.
  • -Verbose - Provides more detail.
  • -debug - Provides debugging information.
  • -ErrorAction - Instructs cmdlet to perform an action when errors occur. Such as: continue, stop, silently continue, and inquire.
  • -ErrorVariable - Use a specific variable to hold error information. This is in addition to the standard $error variable.
  • -OutVariable - Variable used to hold output information.
  • -OutBuffer - Hold a certain number of objects before calling the next cmdlet in the pipeline.

To view common and other parameters available to the “Set-ExecutionPolicy” cmdlet, type the following at the command prompt:

Set-ExecutionPolicy -<tab>

You can cycle through available parameters, for a cmdlet, by continually pressing the “tab” key. Make sure you are using the dash “-” before pressing tab. Note: not only will you see common parameters but, other parameters that are available as well.

Use the “Get-Help” cmdlet for information on parameters available to a cmdlet. Continuing to use the “Set-ExectutionPolicy” cmdlet, let’s get-help:

Get-Help Set-ExecutionPolicy -Full<enter>

In the “Parameters” section, which provides information on parameters available to the cmdlet, there is a list of the common parameters the cmdlet supports.

Examples:

1. In this example, let’s use the -whatif parameter to see “what would happen” if we used the “Set-ExecutionPolicy” cmdlet:

Set-ExecutionPolicy Unrestricted -whatif<enter>

You are presented with the following: Performing operation “Set-ExecutionPolicy” on Target “Unrestricted”.
This is really cool… before you commit any changes you can verify that the cmdlet is going to do what’s expected. Would have been great if “Format C:” had a -whatif parameter.

2. Using the same cmdlet, choose the -confirm parameter to prompt before executing:

Set-ExecutionPolicy Unrestricted -confirm<enter>

Are you sure you want to perform this action?

  • [Y] Yes (Default is “Y”)
  • [A] Yes to All
  • [N] No
  • [L] No to All
  • [S] Suspend
  • [?] Help

Note: Suspend? This option is very useful. Let’s say you are not sure you want to execute the cmdlet because you are not sure what the “ExecutionPolicy” is set to. You can verify the “ExecutionPolicy” before committing the change:

Set-ExecutionPolicy Unrestricted -confirm<enter>

Are you sure you want…

S<enter> (places the prompt in suspend mode as denoted by “>>”).

>>Get-ExecutionPolicy<enter>
Resricted (or whatever the policy is set to).

>>exit<enter> (Typing “exit” leaves suspend mode and returns to the original command)

Are you sure you want…

Y<enter> (Confirms “Yes” and sets the ExecutionPolicy to “Unrestricted”).

We’ve covered a few examples of what you can do with parameters. Since you know how to “Get-Help” for a cmdlet, it’s easy to discover which parameters are available to any cmdlet. Do some exploring and experimentation before moving on to the “Objects” section.

Introduction to Objects

As discussed in an earlier PowerShell tutorial, PowerShell is object-based not text-based. Since we are working with objects, more information exists than what’s presented (by default) on the command line. That information may not be initially visible; by using PowerShell cmdlets, parameters, and script blocks we can interact with an object to provide us with the information we require.

What is an Object?

An “Object” is something we can gather information from and/or perform an action upon. An object, in PowerShell, consists of properties (information we can gather) and methods (actions we can perform).

I don’t remember where I herd the following explanation but it’s one that sticks with me. As an example, let’s look at a “light bulb.” The object should be obvious, it’s a light bulb. The properties of a light bulb could be color, wattage, and type (florescent, incandescent, or halogen). Methods are the actions we can perform on the object such as; turn on the light bulb and turn off the light bulb. Pretty simple right! Let’s look at an object’s properties and methods.

Ingrain this cmdlet in you head, you will use it constantly: “Get-Member.” This cmdlet is used to examine what properties and methods are available to an object.

Example 1. Properties and Methods of the “Get-Service” cmdlet.
Type the following to view the properties and methods of the “Get-Service” cmdlet. In this example, the output of “Get-Service” (object) is piped into the “Get-Member” cmdlet.

Get-Service | Get-Member<enter>
PowerShell Training GetMember cmdlet

Get-Member Results

Image 4.1

You should see something similar to Image 4.1. We have identified which properties and methods are available in the “Get-Service” cmdlet. At this point in your PowerShell training if you are not familiar with what’s in the definition column, you are looking at “Data Types.” For example, the “CanStop” property returns a Boolen “Type.” My guess is that the value would either be “True” or “False.” Don’t be concerned with this right now, we will be covering “Types” in another PowerShell tutorial. Just make a mental note that the “Get-Member” cmdlet also returns “data types.”

Example 2. Getting Properties of the “Get-Service” cmdlet.
In this example we refine our search to display only properties by using the -MemberType parameter.

Get-Service | Get-Member -MemberType Property<enter>

Example 3. Getting Methods of the “Get-Service” cmdlet.

Get-Service | Get-Member -MemberType Method<enter>

For a systems administrator, objects are the “Holy Grail” in managing your environment. Why? Because everything in Windows PowerShell is an object. Let me go off the page here for a second to explain. Since we connect to objects and gather information (properties), we are able to compile a report from practically any request our boss throws at us. If the boss requests that a change (method) is made, we are able to make those changes to one or more objects in the environment.

Here’s an example: Overnight, someone has placed a large number of files on the file server that has taken up 50% of the remaining free space. I know, unrealistic right?!? Just follow me on this one. The boss wants a report of all files that were created in the last day. Your answer… “No Problem.”

Get-ChildItem -Path C:\ -Recurse | Where-Object {$_.LastWriteTime -gt “08/25/2007″}<enter>

Let’s dissect what the command is doing:

  1. We call the “Get-ChildItem” cmdlet because we want to enumerate the file system.
  2. -Path parameter points to the root of C:\ drive as the starting point. The -Recurse parameter means we want all subdirectories and files enumerated.
  3. The object returned from the “Get-ChildItem” cmdlet is piped into a script block.
  4. Where-Object is a looping statement which finds each object that matches the criteria we are looking for.

What I would like you to notice, what is “LastWriteTime”? Type the following command:

Get-ChildItem | Get-Member<enter>

Do you see a property called “LastWriteTime”? We told the command to find each object with the “LastWriteTime” property that has a value greater than 08/25/2007. “-gt” is an operator that means greater than, we talk more about operators in a later tutorial. I mentioned “Types” before as well, the Definition column states that the “LastWriteTime” property is a “System.DateTime” Type. This means it returns values of this type, which is why we used the “DateTime” type “08/25/2007.” Again, we will discuss “Types” in a later PowerShell tutorial.

Did the method “Turn light bulb On” work? I’m hoping that this discussion on objects is starting to paint the big picture for you. Can you think of what type of properties and methods are associated with user objects in Active Directory? If the boss asks for a report of all disabled users; at this point you should recognize that “user” is an object, more than likely it has a property which returns the status of the account, and a method to either enable or disable it. How about properties and methods associated with computers, printers, and security groups. We are going to get into how we can connect to these objects and enumerate/modify them when we discuss WMI, COM objects, and .NET. But for now, the boss wants us to format the report we gave him in the earlier example.

Formatting output

When we execute a cmdlet we are relying on PowerShell to display results. The “Format-” cmdlets allow us to choose which format to display results in. To get a list of formatting options, type the following command:

Get-Command Format-*<enter>

Format-Custom
Format-List
Format-Table
Format-Wide

Format-Table

“Format-Table” cmdlet displays data in rows and columns, similar to what you would see in an Excel spreadsheet. By default, PowerShell attempts to format the view, but doesn’t always display the best results. For example let’s format the output of the “Get-ChildItem” cmdlet for the “C:\Windows” directory.

Get-ChildItem C:\Windows | Format-Table<enter>

I like the table format, but there seems to be too much white space (spaces) between the columns for my taste. Fortunately, there is a parameter -AutoSize to assist us with white space issues.

Get-ChildItem C:\Windows | Format-Table -AutoSize<enter>

O.k. maybe that wasn’t what you were looking for either. As shown from a previous example, use the <tab> key to cycle through the available parameters for the “Format-table” cmdlet. Expierment with each available parameters to see how format is manipulated.

Format-List

“Format-List” cmdlet displays data in… of course, a list. For example:

Get-ChildItem C:\Windows | Format-List<enter>

By default, we get the following properties: Name, CreationTime, LastWriteTime, and LastAccessTime. The boss looks at the list and requests the full path to the files. Use the -Property parameter to list the “FullName” property. Reminder: use “Get-Member” cmdlet to list the available properties:

Get-ChildItem C:\Windows | Format-List -Property FullName<enter>

If your boss is like mine, I usually hear something like… “that’s great, but now I want the full path to all files and subdirectories, creation date, and last time a file was modified.” Your answer… “No Problem!” To enumerate multiple properties, just separate each property with a comma (,) as shown in this example:

Get-ChildItem C:\Windows -Recurse | Format-List -Property FullName,CreationTime,LastWriteTime<enter>

Note: You can also use the -Property parameter with the “Format-Table” cmdlet to build tables, with each property as a header.

Format-Wide

“Format-Wide” cmdlet compresses results of a list, to fit the screen:

Get-ChildItem C: | Format-Wide<enter>

The results are in list format sorted by column, similar to the old “dir /D” command. You can customize the number of columns using the -Column number parameter:

Get-ChildItem C: | Format-Wide -Column 3<enter>

Group-Object

The “Group-Object” cmdlet allows us to format output information based on groups. For example, there is a property call “Company” for the object returned by the “Get-Process” cmdlet. Let’s assign the “Company” property to a group:

Get-Process | Group-Object Company<enter>

The output groups the information as follows:

  • Name – Name provided by the Company property of the Get-Process object.
  • Count – The number of process running from each Company.
  • Group – A truncated list of the processes running.

Here is another example of how to use the “Group-Object” cmdlet. You want to discover which Event IDs are present in the system log:

Get-EventLog System | Group-Object eventid<enter>

Note: The Name column is the Event ID, even though it’s not labeled as such. By default, “Group-Object” places the property you specify in the “Name” column.

Sort-Object

From the example above we are presented with a “Count” column. This indicates the number of occurrences per each Event ID. Just as it sounds, the “Sort-Object” cmdlet provides a mechanism to sort results. In this example, I’m going to further build on the command above to sort from most occurrences to least:

Get-EventLog System | Group-Object eventid | Sort-Object Count -descending<enter>

The results are now sorted from most to least number of occurrences. Couple of things to notice here:

  • I sorted on the “Count” column. You could also sort by “Name” or any column you choose.
  • As shown above you can pipe results from one cmdlet to another and then another, etc…

Convertto-HTML

I love this cmdlet. It’s not the best html conversion, sometimes the output looks great, sometimes not. It’s just fast and I don’t have to write any code to convert results, like I did in VBScript. Let’s send the results of “Get-Process” to html.

Get-Process | ConvertTo-html<enter>

Well, the cmdlet preformed the conversion but I want the result saved to an html file. I’m going to use the “Out-File” cmdlet to redirect the results into a file. This is similar to using the redirect symbol “>” in the old dos command shell.

Get-Process | ConvertTo-html | out-file “Processes.html”<enter>

To open the .html file use the “Invoke-Item” cmdlet. This is equivalent to clicking on a file where the file type determines which application is launched.

Invoke-Item Processes.html<enter>

The default browser is launched presenting the results saved in the html file. Like I said, doesn’t always look great… But it is fast and the html code can be edited (to look pretty) if desired.

Export-CSV

This is another formatting cmdlet that you are going to love. It takes results and converts it to a csv file. In the following examples we are going to Export the processes and open the file in a spreadsheet. You must have Excel or some other type of spreadsheet installed on the system.

1. Export results to a .csv file”

Get-Process | Export-CSV Processes.csv<enter>

2. Open the spreadsheet:

Invoke-Item Processes.csv<enter>
PowerShell Taining ProcCsv file

Process CSV

Image 4.2

As shown, you can use the “Export-CSV” cmdlet to quickly document and/or create reports. Much more simple that what was required to create the same report in VBScript.

Alright, we got through PowerShell Parameters, Objects, and Formatting. We just hit the tip of the iceberg, we will continue utilizing these cmdlet options as we work in later PowerShell tutorials. Obviously, there are more cmdlet options and parameters we have not covered. PowerShell provides the tools (Get-Help and Get-Member) to explore and learn, so snoop around and get your feet wet.

Hope I was able to shed some light on the advantage objects provide over traditional shell “text string” output. As Objects are the heart of PowerShell and PowerShell scripting, we will be working in depth with objects as we continue our PowerShell training. If you have any comments or questions please use the comment section bellow. See you in the next PowerShell tutorial…

Email This Page To A Friend Email This Page To A Friend

Comments

I have been learing powershell for about a month, and I was very impressed with how you laid out this page, with good real world examples. Thanks.

You are welcome… Glad to hear that the information provided is helpful. I’m working on a PowerShell Providers tutorial this week, I’m shooting for Sept. 9th launch.

By JIm Knowles on October 11th, 2007 at 3:46 pm

I’m trying to output the event log information to a file and cannot get what outputs to the screen to display as output in the file. Can you give me any pionters on that
Thanks.

Jim

By Jacob Saaby Nielsen on December 7th, 2007 at 5:05 am

Jesse,

very helpful tutorial. However, I’m missing more indepth stuff like “if you have an array and would like to generate a CSV, HTML or XML file, how do you run through that array and export only the data you want, to that fileformat”.

Because, it seems most tutorials in the books and on the web, only does the very basic examples of e.g. saving to csv or xml files. I’m missing more advanced examples of these cmdlet’s, as they’re extremely useful, especially in conjunction with array and hashtable data.

Jacob,
Thanks for your comment. Regarding your question, I find the best place to get more information is with another cmdlet called Get-Help.
Using:

Get-Help Export-CSV -Full

We find that we are able to use the “Select-Object” cmdlet to export only the properties we are interested in. Using the example in this tutorial, let’s say we are only interested in the ProcessName and ID. Here is how we would export these properties to a csv file:

Get-Process | Select-Object ProcessName,ID | Export-CSV C:\Process.csv

Also try “Get-Help ConvertTo-HTML” to assist.

Hope that helped…

Thank you very much.. I boght two books on PS. But both are for admins wiht scripting knowledge.I wish I had come to this site before. Thank you again .

By chris wood on May 9th, 2008 at 7:58 am

Great tutorial, keeping me intrested with easy to follow examples.

thanks

This was a great tutorial. I was looking around to buy a PS book geared for sys admins, but I think is a better start.

A+ for content!!!

Thanks.

thanks for the great info.

BTW, please note typo in the following (‘dubbing’):

-debug – Provides dubbing information.

I really love your tutorial. It’s easy to understand, especially for newbie like me. thank you very much!

Thank you so much for the tutorials. You kept it interesting by keeping it simple. I’ve been to other site where I lose my attention span in the first 5 minute. Thank you for this great site.

By Christophe on August 5th, 2008 at 3:54 am

thx for these tutorials m8,
its helping me a lot to understand scripting in general.

By NetGuyDave on August 5th, 2008 at 2:39 pm

You stated….” “Get-Member.” This cmdlet is used to examine what properties and methods are available to an object.” But it appears that get-member is only used to view the properties and methods of cmdlets, not objects. To get properties of an object wouldn’t you have to focus on an object, not a cmdlet? What am I missing? Thanks, Netguydave

PowerShell allows you to create .NET objects and explore the members using “Get-Member.” Cmdlets passed via the pipeline are .NET objects. You can also use get-member on other objects such as WMI objects, you will learn how to do this in the WMI Tutorials on this site. The subject is examined in WMI tutorial 1. You will see how we “focus” or bind to the object and enumerate…

By NetGuyDave on August 7th, 2008 at 8:43 am

Thank you. Your tutorials are really helpful. NetguyDave.

By NetGuyDave on August 12th, 2008 at 7:11 am

Jesse, I’m creating objects? I thought I was just enumerating the objects and organizing them into meaningfull order? Sorry if this seems like a stupid question but I think it is an important concept if I’m not understaning it correctly. Objects, from what I understand, are users, computers, printers, wmi, adsi, and other information – I’m not creating anything, I’m just looking at data and possibly modifying it. I don’t get the “allows you to create .NET objects” statement. Are you trying to say that I’m enumerating the objects into a powershell variable, which then allows me to do something with the data? Thank you, Dave

Yes,
PowerShell allows you to create .NET objects using the new-object cmdlet. For example: $theDate = new-object -Typename System.DateTime. I am working on a .NET tutorial that will assist with understanding this concept.
Sound like you are lumping all objects in the same category, you will learn to work with .NET, ADSI, WMI, and COM objects. They are all objects but not the same type of object. For now it is important to understand the difference between PowerShell and the Windows Command Prompt which is PowerShell commands output objects, not blocks of text. Objects have properties and methods giving you a higher degree of power and control.

Thanks Jesse.

You say to type -> Get-ChildItem | Get-Member

I am unable to run Get-ChildItem | Get-Member…

I get the following error ->

Get-Member : No object has been specified to get-member.
At line:1 char:26
+ Get-ChildItem | Get-Member <<<<

Can you assist? Why ?
Thanks

bob, you’re probably in an empty directory. You’ll get that error if you try that command in a directory without any childitems.

Get-Process -name manythanks | ConvertTo-html |out-file “thanks.html”

Invoke-Item thanks.html

Wonderful work… I absolutely love your tutorials!!!

:D

This tutorial is very helpful indeed!

Could you please let me know if we could export the content in an excel sheet to an html file?

Thanks for the wonderful tutorial’s!

when I tried to run this command:

Get-ChildItem -Path C:\ -Recurse | Where-Object {$_.LastWriteTime -gt “07/25/2009?}

the only thing I get is this:

>>

and have to ctl+c to exit out back the
PS prompt

What am I doing wrong?

thanks

SAC – you seem to have missed the cloing apostrophes : “07/25/2009″. It could also be that recursing the c: drive takes an age

Hi, when I run Get-ChildItem -Path C:\ -Recurse | Where-Object {$_.LastWriteTime -gt “10/12/2009″} i get the following errors.

Get-chiditem : access to the path ‘c:\D0a84b…\amd64. is denied

and then i am returend to a

PS C:\MyScripts>

I never see anything displayed. I have a test file that i created on the 13th.

Updated, I got rid of the errors, but in is just returning me to a;

PS C:\MyScripts>

Should I see an output file?

nm, i missed the . in {$_.lastwrite….

I am trying to figure out a way to look at child items in a folder, only take files with a certain extension, then only take those greater than 2 hours old, then delete those files (leaving those less than 2 hours old still in the folder). Anyone have any ideas on this? New to powershell and this is not workable but is a start:
Get-ChildItem C:\test | where-object {$_.extension -eq “.reg”} | Where-Object {$_.lastwritetime -gt(-2)}
Thanks!

Thanks for this information, it’s pretty useful.

very usefull and helpfull information.thank you very, very much

By Vishwas Setty on May 21st, 2010 at 8:08 am

Hey,

The first thing you talk about in this tutorial is get-executionpolicy which u say us to provide the – and commands..but the get-executionpolicy is to set or get the policy like unrestricted/restricted or stuffs like that…I am confused with the first one..Plz help me…

Regards
Vishwas

can’t find the “Turn light bulb On” method
=P

Hello,

I wonder about the “Get-Process | Group-Object Company”
The command works, I can group my processes by company but when i run “Get-Process | Get-Member” I can’t find a Property named “Company”.
I don’t understand, isn’t Get-Member listing all available Properties of an object?

By Dheeraj Kanungo on December 8th, 2010 at 6:26 am

I found all the articles to be very useful.And expained in a beautiful manner.Thanks for writing

I’ve been trying to read MS press books on powershell, and just couldn’t get a handle on it. the way everything is laid out here, and with the examples you have, i learned more in 3 hours than i did in 2 months of reading. Thank you so much for this.

The tutorial is great. I was a server admin for years. This will assist me in my PM role. Your Chapters are well laid out and I am picking things up well. That says a lot for your PowerShell knowledge and your ability to teach old .bat guys like myself.

Thanks very much

Good one.I made some progress today

It’s really excellent

By alencdave on June 27th, 2011 at 6:49 am

I ran the following and get output as expected :
>> Get-Command | Format-Table

But I was not able to convert it to HTML proeprly , I wrote the following

>> Get-Command | Format-Table | ConvertTo-HTML | Out “PS-Command.html”

though it is creating PS-Comand.Html file but output is not same.

Would ypu please explain How to use Format cmdlets and ConvertTo-HTML together?

Excellent tutorials…..Easy to follow and keeps me interested….I especially like the convertTo-html cmdlet! …..Next chapter….

I am an absolute beginner to PowerShell. I have dabbled with Visual Basic, and work some with cmd.exe. I have always wanted to learn a scripting language, but I want to learn the most powerful, most versatile scripting language around. I help manage an IT Staff as an analyst for the military. I do not have direct domain controller access, but I do understand Domains, OU’s, sites, and such.
I would like to say thanks? Your effort in helping the beginner is commendable, I am interested in learning this language, mostly because it is very versatile and so usable. Are there many uses for scripts at the local desktop level, or that we can use to make our job easier? We service support an entire command, and so many tasks that we do could be automated if one of us knew a decent scripting language. Is PowerShell that language, especially since we are transitioning from XP to 7?

Can you suggest a good textbook for the absolute beginner?
Thanks for helping the folks that are unsure which way to go? SALUTE!

Cybertek,

If automation is what you are after PS is the way to go. I am desktop support for a mid-large company and anything that I need to do more than twice goes straight into Power Shell. Makes my job easier and has increased productivity.

As for a beginner’s textbook, have a look at “learn power shell in a month of lunches” Don Jones

Hope it helps.

Howdy!

Thanks very much for this tutorial. I am having a good time with it.

I am trying to go a bit off the page between things and keep getting stuck though.

I start with listing the base cmdlets:
get-command

OK, then I get running a command through get-member to see the attributes of the object:
say I select get-service
get-service|get member

Now, how do I create a list of services where say for example Status=running?

I can already see this is going to be a very useful tool. I just have a whole lot of learning to do!

Ahhh:

Get-Service | Where-Object {$_.Status -eq “stopped”}

But there must be a cleaner way to display just one parameter of an object…

I get an error when I run…

Get-WmiObject -Class Win32_ScheduledJob -Namespace root\CIMV2 | Get-Member

The error is… Get-Member : No object has been specified to the get-member cmdlet.

I am running PowerShell gui ver 3.0.0.2015

Thanks,
Tony

Thank you really for this awsome work. I was thinking I never will learn this.

But you use so easy words and examples and you also explain all this things.

If you visit Vienna, you have a free beer with me :D

By ibrahim edib kokdemir on February 5th, 2012 at 7:00 am

thanks for the tutor. great tutor for newbies.

Great Tutorial,

I was trying to “get-member”, for format-list and it appears there is nothing to list.

Format-List | Get-Member

Just returned errors, for this cmdlet, works for everything else.

Get-ChildItem | Format-List | Get-Member

Seemed to get me there, is this because the Format-List Can have different options based on other cmdlet’s?

Great series so far! Only criticism I have at this point is that it’s sometimes difficult reading your code boxes. A monospace font would help show where spaces are needed.

Thanks for putting these tutorials together!

By Doug Potter on June 16th, 2012 at 11:10 am

herd -> heard

By John Kimble on June 19th, 2012 at 1:59 pm

This tutorial is great. Well organized, functional examples. I’ve not seen many tutorials done this well.

By .Net training course on July 21st, 2012 at 3:55 am

.NET Framework is a new and revolutionary platform created by Microsoft for developing applications. Microsoft release of the .NET Framework runs on the Windows operating system, it is fast becoming possible to find alternative versions that will work on others

By Steve Moore on August 21st, 2012 at 2:28 am

I’m enjoying learning power shell. Mostly because of this tutorial. I’d just like to say thank you for writing it.

The examples are good. But all examples are given in the help of Powershell ISE.

By Derek Lockhart on February 1st, 2013 at 3:30 am

Superb site. Thankyou very much for writeing and maintaining it.

Very helpful site! Thank you.

AAAAAA++++++++++++++++

Thank you very mach for this very clear and usefull tutorital !!!

Very helpful and easy to understand.
Thank you very much!!!

Good tutorial..
But I want to take HTML output to next level.
I want Show/Hide or Expand Collapse link to show/hide my HTML output.
If I want to get Services and Process details so it should come with Show/Hide format.
Kindly Assist.

After a couple interviews, I realized that learning PowerShell wasn’t really optional for me any more. Your tutorials are very well written, and the examples are “real world” type stuff that I immediately saw the usefulness of.

I’m a newbie. This tutorial was very helpful in getting up to speed. Looking to the next in the series.

Thank you for the brilliant and fun tutorials! I’ve just had one problem:I can’t launch the html file in any of my browsers,according to Chrome “the file has not been found”… :’( I’m a newbie and have a feeling I could be missing something obvious, but don’t know what. Help??

Hi,
Thanks for this brilliant tutorial. Very very useful to the beginners like me…Keep Rocking :)

I am trying to get the details on running services in my machine but i could not get the output when i try this
Get-Service | Where-Object {$_.Status -eq “started”}

But i can see the output when i try the same syntax for the stopped services

Get-Service | Where-Object {$_.Status -eq “stopped”}

I am confused here..

Hi Srini,

Services are “running”, not “started” :-)

Hi,

I cannot get this to work! :)

get-childitem -path C:\ -recurse ¦ where-object {$_.lastwritetime -gt”09/12/2013″}

Every time I get:

Get-ChildItem : A parameter cannot be found that matches parameter name ‘where-object’.
At line:1 char:14
+ get-childitem <<<< -path C:\ -recurse ¦ where-object {$_.lastwritetime -gt"09/12/2013"}

Am I doing something wrong??

Many thanks

By FastIntruder on December 12th, 2013 at 2:26 pm

Norco, put a space between gt and ”

I also think the tutorial is great!

By Kevin K Woo on January 1st, 2014 at 3:48 pm

Thank you for making this page. I love seeing how to work with objects and pipes. Truly, get-member is brilliant.

Hi,
It’s really a great tutorial for PowerShell beginners ! Thanks a lot…

Great work …thanks a lot

Hi,

Have you published a book ?. If not please start working on it !!

You will make your life meaningful by writing one and helping others :)

A great work

I love how you describe objects, properties and methods.
The light bulb example make it easier to understand the concept.

 

Leave a Comment