Essential Questions
- How can I make repetitive tasks more bearable?
- How can I use the technology resources at my disposal to make my job easier and make me more efficient?
Big Ideas
Scripts are short lines of code or code-like statements that allow IT staff to perform routine operations or processes without having to key them in every time. And because IT staff run into similar kinds of needs regardless of where they work, many people make their scripts available to others. They can be copied and used as they are or customized to specific needs.
There are different languages and tools that can interpret scripts. To work in IT Support, you most likely won’t be writing long lines of code, but you may have to find, read and understand, and use scripts.
Connection to Student Lives
Have you ever used block coding? Maybe you had a class or went to an afterschool club where you practiced using block coding with activities from Hour of Code or another coding tool? Or maybe you used programmable robots that had to run an obstacle course or accomplish some other task?
Scripting uses many elements similar to coding or programming, but they usually aren’t as long as codes for software, or a game, or other uses. Scripts are short snippets of code or code-like statements that you can use to automate processes that you have to do over and over. Creating a short script of 5-10 lines that can do something over and over without you even needing to be present can save you lots of time so you can work on other things, maybe like getting back to those programmable robots?
Framing Problem
Use Windows PowerShell to create and run basic scripts.
Cornerstone Assessment
Students work through a script example, making and recording their observations as to how the script operates and what the outcomes are or should be.
DPI Standards
- NCCTE.2020.II22.04.08 - Identify the basics of scripting.
A+ Standards
TOPIC 18E: Basic Scripting Concepts
Knowledge
- The difference between a compiled program and a script that is interpreted
- Examples of compiled language programs, such as Perl, Java™, C, and C++®
- Examples of general purpose scripting languages, such as Visual Basic®, Python®, and JavaScript®
- Batch files and PowerShell® in Windows OS and shell scripts in LINUX are also script files
- File extensions for common scripting languages
- General characteristics and how to run batch files, Windows PowerShell scripts, a LINUX shell script, VBscript, JavaScript (which is different from Java), and Python scripts
- Basic scripting constructs, such as
- Why comments are helpful in scripts and the comment syntax for the script languages listed so far
- Common environment variables that identify a storage location in the OS command shell
- How branches and loops operate
- Basic comparison operators
- How to compare conditions using logical operators
- Data types
- Escape characters and why they are used
Skills
- Explain how to run batch files, Windows PowerShell scripts, a LINUX shell script, VBscript, JavaScript (which is different from Java), and Python scripts
- Use basic scripting constructs so you can interpret what a script is intended to do
- Read comments in a script
- Use the set command in Windows or the printevnv or env command in LInux to view and change variables
- Interpret branching or looping scripts
- Read or use escape characters in a script
Vocabulary
Basic Scripting Concepts
Script file
Scripting language
- Interpreter
- Command interpreter
- Executed
- Integrated Development Environment (IDE)
Compiled program
Comment Line
Identifier
- Stored value: Variable or a Constant
- Declared variable
- Data type
- Routine
- Undeclared variables
Environment Variable
Branch
Loop
Comparison Operators: ==, !=, <, L, <=, >=
Logical Operators: AND, OR, XOR
Data Types
- Integers
- Floating point numbers
- Boolean values
- Characters
- Strings
- Escape character
Weekly Map
Monday
Introduction to problem: Reading and Creating Basic Scripts
Online Pre-assessment (available for student practice, as well)
Tuesday
Review content resources with whole group: Topic 18E: Basic Scripting Concepts
Small group and independent exploration of resources
Wednesday
Hands-on exploration with IT professionals: 18-7: Using Windows PowerShell
Activity 18-6: Discussing Scripting
Thursday
Hands-on exploration with IT professionals: 18-7: Using Windows PowerShell
Optional Review Time
Friday
Progress check with individuals or whole whole group
Online post-assessment
Optional Review Time
Lesson Ideas
Using examples of scripts, many of which can be found online, have students practice determining the outcome of the script by exploring simple script syntax and features. As they compare short scripts in different languages, have them identify basic elements such as comments, variables and constants, branches and loops, and operators. Students are not going to become fluent programmers in a few days; however, they can recognize common scripting elements and determine how they are structured. They can be encouraged to find their own examples of scripts, perhaps those they can test in Windows PowerShell.
Potential Resources
The Official CompTIA A+ Core 1 & Core 2 Instructor Guide for Exams 220-1001 and 220-1002
- Topic 18E: Basic Scripting Concepts (pp. 1032-1040)
- Activity 18-6: Discussing Scripting (p. 1041)
- Activity 18-7: Using Windows PowerShell (pp. 1042-1047)
ITProTV
- Top 5 Useful PowerShell Commands (18:51)
Professor Messer at ProfessorMesser.com and YouTube offers numerous free videos of various lengths for many of the topics for the CompTIA 220-1001 A+ Exam. They are easy to understand, narrated videos with visuals. If you are teaching a CompTIA course, the site notes “You’re welcome to use them as much as you’d like, provided you embed the videos with the associated YouTube link or link directly to my site. Please click the “Contact Us” link at the top of our web page and let me know how you’re using them.”
- Professor Messer’s 220-1001 Core 2 CompTIA A+ Training Course videos on ProfessorMesser.com. Search or scroll to find the topics you’re interested in.
Entry Level I.T. Training from Technology Gee
Microsoft Support
- What is PowerShell?
- Getting Started with Powershell is the first chapter in an online book
Other Articles and Resources:
How to create and run a PowerShell script file on Windows 10 by Mauro Huculak for Windows Central (contains advertisements)