Question: PowerShell Script [Windows] Goals/Objectives: Write a simple PowerShell script Specific Directions with Specific Grading Criteria: Write a PowerShell script that: (20%) Takes one command line

PowerShell Script [Windows]

Goals/Objectives:

Write a simple PowerShell script Specific Directions with Specific Grading Criteria:

Write a PowerShell script that:

(20%) Takes one command line argument in the form of a path to a directory.

o (10%)If the directory does not exist, tell the user and exit quietly.

Using the files in the directory do the following:

o (10%) For any files that happen to be directories, show the text [Directory] and then the full pathname.

o If it is a regular file, show: (10%) The text [File] (20%) The size of the file in Bytes.

(10%) The name of the file.

o (20%) Neat formatting, output should beconsistent with the sample below.

Submit your .ps1 file via Moodle.

PowerShell Script [Windows] Goals/Objectives: Write a simple PowerShell script Specific Directions with

Example output: Type Path/Size Name [Directory] c:\Oracle Directory] c:\PerfLogs Directory] c:\Program Files [Directory] C:\Program Files (x86) Directory] c:\Python34 Directory] c:\TeamVi ewer Directory] c:\Users Directory] c:\windows Directory] c: \Windows.old File File File File File File File File File File File File File File File File File 17 KB 17 10 KB 17 KB 17 KB 0 KB 17 KB 17 KB 17 KB 1 KB 550 KB 1 KB 75 KB 94 KB 89 KB 95 KB 93 eula.1028.txt eula.1031.txt eula.1033.txt eula.1036.txt eula.1040.txt eula.1041.txt eula.1042.txt eula.2052.txt eula. 3082.txt lobdata.ini nstall.exe install.ini nstall.res. 1028.d11 install.res.1031.d11 install.res.1033.d11 instal1.res.1036.d11 instal1.res.1040.d11 instal1.res.1041.d11 Example output: Type Path/Size Name [Directory] c:\Oracle Directory] c:\PerfLogs Directory] c:\Program Files [Directory] C:\Program Files (x86) Directory] c:\Python34 Directory] c:\TeamVi ewer Directory] c:\Users Directory] c:\windows Directory] c: \Windows.old File File File File File File File File File File File File File File File File File 17 KB 17 10 KB 17 KB 17 KB 0 KB 17 KB 17 KB 17 KB 1 KB 550 KB 1 KB 75 KB 94 KB 89 KB 95 KB 93 eula.1028.txt eula.1031.txt eula.1033.txt eula.1036.txt eula.1040.txt eula.1041.txt eula.1042.txt eula.2052.txt eula. 3082.txt lobdata.ini nstall.exe install.ini nstall.res. 1028.d11 install.res.1031.d11 install.res.1033.d11 instal1.res.1036.d11 instal1.res.1040.d11 instal1.res.1041.d11

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!