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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started