Learning PowerShell – Homework Six Answers
PowerShell Homework Six
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. What is the PowerShell clear command used for?
The PowerShell clear command is used to clear data off of the screen.
2. In your own words what does an if statement do?
An “if” statement will test to see of the condition of something matches a predefined item. You can then take action based on those results.
3. In your own words and not using an example from the lesson what on the physical world could be an object and list four of that objects properties.
An object can be almost anything for example a house: A house has door, kitchen, roof, bathroom, etc…
4. From the lesson Name, Status, and DisplayName are properties of what object? Hint: it starts with System.
5. Why is PowerShell object oriented?
PowerShell is object oriented because .Net is an object oriented language and PowerShell is built on .Net.
6. Write a small script to get the processes on a system, but only display the information for the processes you define in a variable.
(This is your homework)
7. Expand this script from question 6 to only display information if the service is not running. Hint: you learned about the “Not” operator in lesson Two I hope you did the homework!