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
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