Assignment O

Solomon Kane
Week4Assignment.docx

Prompt

Create a single PowerShell script, that contains the following components:

• The file should be named (last name) _week4_assignment.ps1

• A header that contains the following comments:

◦ Name: (your full name)

◦ Assignment: OPS304, Week 4

◦ Purpose: Working with Loops in PowerShell

◦ Date: (today's date)

• Complete each section and provide a comment above each section:

◦ Part A-For Each cmdlet

Display all the elements in the following array separated with a comma

◾ $array = @ ("Networking", "Programming", "Scripting")

◦ Part B-For Each abbreviated cmdlet

◾ Display all the elements in the following array separated with a comma

◾ $array = @ ("Networking", "Programming", "Scripting")

◦ Part C-For Each construct

◾ Display all the elements in the following array separated with a comma

◾$array = @ ("Networking", "Programming", "Scripting")

◦ Part D-While loop

◾ A script that loops from 0 to 30 (increment by 1) and adds the current value to the previous value

◾ Display the final value.

◦Part E-Do-While loop

◾A script that loops from 0 to 30 (incremented by 5) and adds the current value to the previous value

◾Display the final value

You will only need to submit the single PowerShell script. The week 4 assessment should following the same format as the sample file: lastname_week4_assignment.ps1Preview the document