Learning PowerShell – Homework Eight Answers

Share:
PowerShell

PowerShell Homework Eight

By: Steven Aiello

Answer the questions as best as possible in your own words. By answering the question in your own words you will learn more than simply repeating what you’ve heard. You are encouraged to visit the source links in the lessons to do more research on the subject.

Remember the point of the homework is not simply to finish, but to learn!

1. In your own words write an example of a loop that you perform in your day to day life

If(“want to make money” –eq “true”){

Goto-work

}

2. What loops run while in a true condition?

The while loop executes while in a true condition.

3. What loop runs while in a false condition?

The “do until” loops executes while in a false condition.

4. What PowerShell loop sets the variable, the condition, and the iteration of the variable all in one?

The “for” loop is the loop that sets the variable, the condition, and the iteration all in one statement.

5. Describe in your own words what a foreach loop is used for.

The “foreach” loop is one that’s especially powerful because it iterates through a collection of objects. You can then work with each object in the collection individually.

Share:

Leave a reply

+ sixty two = sixty eight

This site uses Akismet to reduce spam. Learn how your comment data is processed.