logo Mon, 23 Dec 2024 09:16:45 GMT

Learn PowerShell Scripting in a Month of Lunches


Synopsis


PowerShell is both a scripting language and an administrative shell that lets users control and manage nearly every aspect of Windows, from Azure to SharePoint. It's also a great platform for building reusable tools and utilities that make everyday administration faster and easier.

 

Inside, readers discover how scripting is different from command-line PowerShell, as they explore concrete hands-on examples. This book includes and expands on many of the techniques presented in Learn PowerShell Toolmaking in a Month of Lunches.

 

Key features

    A crash course in PowerShell Scripting

    Hands-on examples

    Real-world practices

 

Written for developers and administrators comfortable with PowerShell as a command-line interface and familiar with Windows administration in general.

 

PowerShell has a strong ability to create highly reusable, context-independent tools, which it refers to as commands. A command might not be terribly useful by itself, but PowerShell is designed to make it easy to "snap" commands together.

Don Jones, Jeffery Hicks

Summary

Chapter 1: Getting Started with PowerShell

* Introduction to PowerShell and its uses
* Installing and configuring PowerShell
* Basic PowerShell commands and syntax
* Example: Displaying system information using Get-ComputerInfo

Chapter 2: Working with Objects and Properties

* Understanding PowerShell objects
* Accessing object properties
* Filtering and sorting objects
* Example: Getting a list of running processes and their properties

Chapter 3: Using Cmdlets and Scripts

* Cmdlets and their syntax
* Creating and running PowerShell scripts
* Error handling and debugging
* Example: Creating a script to check for updates and install them

Chapter 4: Working with Files and Folders

* File and folder management cmdlets
* Creating, moving, and deleting files and folders
* Searching for files and folders
* Example: Script to search for all files of a certain type in a directory

Chapter 5: Managing Windows Services

* Service management cmdlets
* Starting, stopping, and restarting services
* Enabling and disabling services
* Example: Script to check the status of a particular service

Chapter 6: Working with the Registry

* Registry management cmdlets
* Reading and writing registry values
* Creating and deleting registry keys
* Example: Script to set the default printer

Chapter 7: Advanced PowerShell Techniques

* Advanced features like modules, functions, and pipelines
* Using hash tables and arrays
* Exception handling and try/catch
* Example: Script to create a custom function for calculating the area of a circle

Chapter 8: PowerShell and Active Directory

* Managing Active Directory objects
* Creating, modifying, and deleting users, groups, and OUs
* PowerShell Active Directory cmdlets
* Example: Script to add a new user to a group

Chapter 9: Using PowerShell for Automation

* Scheduling PowerShell scripts
* Using background jobs to run tasks concurrently
* Monitoring and managing running tasks
* Example: Script to automatically install updates on multiple servers

Chapter 10: Troubleshooting and Advanced Topics

* Troubleshooting common PowerShell errors
* Using PowerShell Desired State Configuration (DSC)
* Remote PowerShell and managing multiple computers
* Example: Script to remotely execute a command on a remote computer

Assassin's Creed Atlas

Assassin's Creed Atlas