Question: Everything in Windows PowerShell is a .NET object, and is available for reflection, including cmdlets, services, and processes. Windows PowerShell extends the .NET type reflector

Everything in Windows PowerShell is a .NET object, and is available for reflection, including cmdlets, services, and processes. Windows PowerShell extends the .NET type reflector to allow simpler access for administrative purposes.

In this step, you will learn how to view the type members of those objects.

1. To view the type metadata for the object output by the Get-Service command, type the following command, and then press ENTER.

PS >Get-Service | Get-Member

The type metadata for the object output by Get-Service is displayed. Note that the data type, in this case the System.ServiceProcess.ServiceController class, is also displayed.

2. To view the type metadata for the object output by the Get-Process command, type the following command, and then press ENTER.

PS >Get-Process | Get-Member

3. To create a new object of type System.Diagnostics.Process and view the type metadata for the class, type the following command, and then press ENTER.

PS >New-Object System.Diagnostics.Process | Get-Member

The type metadata for the System.Diagnostics.Process class is shown.

4. Type the following command, and then press ENTER to view a list of services that the Spooler service depends on.

PS >Get-Service Spooler | Select-Object ServicesDependedOn

A list of services that the Spooler service requires to start is displayed.

USE WINDOWS POWERSHELL, SHOW INPUT AND OUTPUT FOR EVERY STEP MADE AND A SCREEN SHOT FOR EVERY STEP MADE AS WELL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!