Question
1a) Problem Write code that when executed in PowerShell, will satisfy the following requirements: Fill in the missing operator used to assign values to variables
1a) Problem Write code that when executed in PowerShell, will satisfy the following requirements:
Fill in the missing operator used to assign values to variables and properties
PS:> $Processes Answer Get-Process
1b) Write code that when executed in PowerShell, will satisfy the following requirements:
Display the contents of the directory: C:\Program Files
Include only the name, length, and last write time in the output.
Pipe the result into the format table cmdlet
Use only one line to solve the problem.
1c)Write code that when executed in PowerShell, will satisfy the following requirements:
Retrieve a list of the provider drives in the current session.
Filter the results to only see names that start with HK
Only include the name, provider and root properties in the results.
Sort the results by root in ascending order
1d)Write code that when executed in PowerShell, will satisfy the following requirements:
List services installed on the system using the get-service cmdlet
Use the Where-Object cmdlet to find all the services that contain Windows in their Display Name
Use only one line to solve the problem.
1e) Write code that when executed in PowerShell, will satisfy the following requirements:
Your answer will consist of two lines:Line 1
Set the current working location to the root of the alias provider using a cmdlet.
Line 2
Retrieve the items in the current location .
Filter the results using the where object cmdlet so that only items that have a name that starts with the letter w are included.
Only include the name column in the results.
1g)Write code that when executed in PowerShell, will satisfy the following requirements:
You have a variable called $mySubstring = "This is my substring example"
Display only the characters "This is my" from your variable
Sort the results by name in descending order
1f)Write code that when executed in PowerShell, will satisfy the following requirements:
Display a list of all processes
Filter the results using the Where-Object cmdlet, so you only see processname that begin with chrome.
Use only one line to solve the problem.
1h)Write code that when executed in PowerShell, will satisfy the following requirements:
You have been given a variable: (paste this into your IDE)
$mystring = "Apples, Bananas, Oranges, Pears"
Create an array called $splitString and assign the below to the variable
using the $mystring variable split the string into an array using the comma as its separator
Display the results inside the console window.
1i)Write code that when executed in PowerShell, will satisfy the following requirements:
Fill in the missing code to satisfy the following:
Get the items in the location
show the name column
show the length column with a label of "Size" and show the bytes in KB
sort the information by length and in descending order
Format the results as a table.
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