Windows PowerShell Scripting Primer
PowerShell Tutorial 6: PowerShell Scripting – Introduction to Script Writing
It’s time to take what we have learned and apply it to writing scripts. The plan is six new and exciting PowerShell tutorials to explain the fundamentals of the PowerShell scripting language. Here is what will be covered:
- Variables, Constants, Arrays, and Hash Tables.
- Using Conditional Logic.
- Processing data with Loops.
- Modular Scripting Using Functions.
- Scripting using WMI Objects (Computers, Printers, Etc…).
- Scripting using ADSI Objects (Active Directory Management).
Variables, Constants, Arrays, and Hash Tables
What’s in Tutorial 7:
- String manipulation and concatenation.
- Storing and Retrieving information using variables and Constants.
- Operators and Expressions.
- Creating, Modifying, and Combining Arrays and Hash Tables.
Tutorial 8. explains:
- Testing conditions and running commands based on results.
- Introduce and work with “if” and “Switch” statements.
- Using Operators to test conditions.
Tutorial 9. gets loopy:
- Applying “while,” “do while” and “do until” loop processing.
- Applying “for” and “foreach” loop processing.
Modular and Dot Source Scripting using Functions
Clean up your act in Tutorial 10:
- Organizing your code
- Enlisting “Data Types”
- Calling Functions from other scripts
PowerShell Scripting using WMI Objects
Tutorial 11. Oh my! WMI:
- Concept of WMI namespaces.
- The WMI Provider.
- Navigating and using the WMI namespace.
- WMI Classes.
- Using the “Get-WmiObject” cmdlet.
- Querying WMI.
PowerShell Scripting using ADSI Object (Active Directory Objects)
Tutorial 12. Administration without the GUI:
- Concepts of Active Directory Objects.
- The ADSI Provider.
- The Active Directory namespace.
- Creating and modifying Active Directory Objects (Users, Computers, OUs, Groups, etc…)