Question: A)Write code that when executed in PowerShell, will satisfy the following requirements: Display the running processes Select only ID and ProcessName Export the results to

A)Write code that when executed in PowerShell, will satisfy the following requirements:

Display the running processes

Select only ID and ProcessName

Export the results to C:\PS\processes.csv

b) Write code that when executed in PowerShell, will satisfy the following requirements:

You need to list all of the members, properties and methods for the Get-Process cmdlet

Display only the Name and MemberType

Sort the results by name in descending order.

C) Fill in the missing code that will satisfy the following requirements:

You need to list the name for each object when running Get-Process cmdlet

Write the name to the host screen and make the foreground colour Red

Write the ID to the host screen and make the foreground colour Green

PS:> Answer | Answer

{ Write-Host Answer -ForegroundColor Answer

{ Write-Host $_.Id AnswerGreen

Use only one line to solve the problem.

D) Write code that when executed in PowerShell, will satisfy the following requirements:

Retrieve a list of the provider drives in the current session.

Only include the provider and name columns in the results.

Sort the results by provider in descending order.

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!