COMP2101 - Administrative Shell Scripting - Working With Data In Powershell
Introduction
In this lesson, we look at how objects and data typing affects what we can do with Powershell.
Learning Objectives
At the end of this lesson, students will be able to:
- use testing of objects with the where-object filter cmdlet to control data passing through a pipeline
- use select-object to filter object in a pipeline or create new simple objetcs
- use select-string and get-childtem to search for text strings in data, and files on the computer
- group commands into script blocks and use the $_ syntax for accessing objects in a pipeline
- identify data types of objects and their members
- use operators for assignment, arithmetic, comparison, and logical operations to combine objects
- perform, and understand the implications of, data conversions
- use variables to store and retrieve objects
- create and use collections of objects, in both simple arrays and associative arrays (sometimes called hashes)
- create custom properties for new objects
These objectives are in support of Learning Outcomes 2, 3, 4, 5, and 6 in the Course Outline.
To do List
- Read through the presentation
- Perform the lab activities as described below
- Do the quiz for this topic
Lesson Material
Learning Activity
Participate in the class and review the presentation. Briefly review any materials available online mentioned in the presentation.
Do the Powershell Data Lab.
Graded Activity
The lab is designed to give you hands-on experience and allow you to research and practice the details of the tasks in the lab. This lab is not graded but you will find the next lab very difficult to accomplish and the quiz difficult to succeed on if you do not do the lab activities first.
Quiz
When you have participated in the class and completed the lab, you will be prepared to write the quiz. The quiz is found on Blackboard under Assignments & Tests. The quizzes provide your testing mark for this semester.
Summary
In this module, you have been introduced to working with objects in Powershell. The tasks you should now be capable of include:
- testing of objects with the where-object filter cmdlet to control data passing through a pipeline
- using select-object to filter object in a pipeline or create new simple objetcs
- using select-string and get-childtem to search for text strings in data, and files on the computer
- grouping commands into script blocks and using the $_ syntax for accessing objects in a pipeline
- identifying data types of objects and their members
- using operators for assignment, arithmetic, comparison, and logical operations to combine objects
- performing, and understanding the implications of, data conversions
- using variables to store and retrieve objects
- creating and using collections of objects, in both simple arrays and associative arrays
- creating custom properties for new objects
Completing the quiz will provide you with a measure of your knowledge in these areas. For the next class you should have your computing environment available with access to Windows 10.