Question: Hi I am having problems solving my assignment on power shell. Using Visual Studio Code, create a shell script named myscript.ps1 Save myscript.ps1 to the

Hi I am having problems solving my assignment on power shell. Using Visual Studio Code, create a shell script named myscript.ps1 Save myscript.ps1 to the appropriate location on your system: Windows: "My Documents" Folder Mac OS X: /Users/ Linux: /home/ Write some code in myscript.ps1 that will list all files (files only - no subdirectories) in the following directory, sorted by filename in descending order: Windows: C:\Windows\System32 Mac OS X: /usr/bin Linux: /usr/bin Read the directory listing into PowerShell, then display every other filename to the screen. Hint #1: Use the pipeline! Pipe a directory listing to the Sort-Object cmdlet for sorting. Pipe the resulting sorted list to the Foreach-Object cmdlet. Hint #2: Read each "Object" from the resulting list, using the Get-Content cmdlet, and the FullName property of each object - like: Get-Content $_.FullName

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!