My Account Log in

1 option

PowerShell 7 Workshop : Learn How to Program with PowerShell 7 on Windows, Linux, and the Raspberry Pi / Nick Parlow.

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Parlow, Nick, author.
Language:
English
Subjects (All):
Microsoft Windows (Computer file).
Windows PowerShell (Computer program language).
Computer programming.
Scripting languages (Computer science).
Physical Description:
1 online resource (468 pages)
Edition:
First edition.
Place of Publication:
Birmingham, England : Packt Publishing, [2024]
Biography/History:
Parlow Nick: Nick Parlow is a Fujitsu Fellow and has been an email specialist for the last 20 years. He's a Microsoft Certified Master in Exchange, a VMware Certified Advanced Professional, and a Microsoft Certified Trainer. He's got master's degrees in network engineering from Sheffield Hallam and software engineering from Northumbria. Best of all, he's a Raspberry Pi Certified Educator. Before IT, he worked as a metallurgist, including at the Joint European Torus, and also worked as a deckhand and a tree surgeon's mate. It's all good. He works with schools in Hertfordshire, teaching programming and physical computing. In his spare time, he likes to play with chainsaws, watch Welsh rugby, listen to punk music, and drink cider.
Summary:
Exercises -- Further reading -- Chapter 5: PowerShell Control Flow - Conditionals and Loops -- An introduction to IDEs and VS Code -- Installing VS Code -- Configuring VS Code for PowerShell -- Conditional control - if, else, elseif, and switch -- The if statement -- The switch statement -- Loops - foreach, do while, do until, while, for -- The foreach loop statement -- The do while and do until loop statements -- The while loop -- The for loop -- Breaking and continuing -- The break statement -- The continue statement -- Let's play a game -- Summary -- Exercises -- Further reading
Contents:
Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: PowerShell Fundamentals
Chapter 1: Introduction to PowerShell 7 - What It Is and How to Get It
Technical requirements
What is PowerShell 7?
What is PowerShell 7 used for?
Scripting languages versus system programming languages
Getting PowerShell 7
Installation from an .msi file
Installation from the .zip file
Installation with winget
Other ways to install
Running PowerShell 7
Running PowerShell with administrator privileges
Autocomplete
Getting help
Get-Command
Get-Help
Get-Member
Summary
Exercises
Further reading
Chapter 2: Exploring PowerShell Cmdlets and Syntax
What are cmdlets?
Exploring cmdlet structure
The correct use of aliases
Understanding cmdlet syntax
How to find more cmdlets
Finding modules and cmdlets on your machine
Finding new modules and cmdlets
Working interactively with PowerShell
Windows Terminal - an alternative terminal emulator
Installing Windows Terminal from Microsoft Store
Chapter 3: The PowerShell Pipeline - How to String Cmdlets Together
How to bring cmdlets together - the pipeline
What is an object?
Selecting and sorting objects
Using Select-Object
Ordering objects with Sort-Object
Filtering objects
Understanding comparison operators
Understanding Where-Object advanced syntax
Multiple filters in the advanced syntax
Filter optimization
Enumerating objects
Parallel enumeration
How the pipeline works - parameter binding
Understanding ByValue parameter binding
ByPropertyName parameter binding
Troubleshooting the pipeline - pipeline tracing
Further reading.
Chapter 4: PowerShell Variables and Data Structures
Understanding PowerShell variables
Variables are not their contents
Naming variables
The three common types of PowerShell variable
Exploring object types
What is an object? - redux
Discovering value types
Booleans
Integers
Real numbers
Char
Typing explained
Dynamic versus static typing
Casting variables
Navigating reference types
Arrays
Strings
Hashtables
Splatting - a cool use for hashtables
Chapter 5: PowerShell Control Flow - Conditionals and Loops
An introduction to IDEs and VS Code
Installing VS Code
Configuring VS Code for PowerShell
Conditional control - if, else, elseif, and switch
The if statement
The switch statement
Loops - foreach, do while, do until, while, for
The foreach loop statement
The do while and do until loop statements
The while loop
The for loop
Breaking and continuing
The break statement
The continue statement
Let's play a game
Chapter 6: PowerShell and Files - Reading, Writing, and Manipulating Data
Understanding formatting
Format-List
Format-Table
Format-Wide
Formatting gotchas
Writing a text file
Using ConvertTo- and Export- cmdlets
CSV
XML
HTML
Handling files
A brief note about PSProviders and PSDrives
Item- cmdlets
Working with files
Get-Content
Import- cmdlets
Let's have some fun - measuring the most frequent words in a text file
Chapter 7: PowerShell and the Web - HTTP, REST, and JSON
Working with HTTP
Why don't we see Forms information in PowerShell 7?
Authentication
Getting to grips with APIs
RPC APIs
SOAP APIs
REST APIs
WebSocket APIs.
Working with REST
Invoke-RestMethod
Working with JSON
ConvertFrom-Json
ConvertTo-Json
Test-Json
Let's have some fun - who is on the International Space Station?
Part 2: Scripting and Toolmaking
Chapter 8: Writing Our First Script - Turning Simple Cmdlets into Reusable Code
Introduction to scripting
Why do we want to write scripts?
Getting scripts
Running scripts
Writing a script
Identifying changing values
Working with parameters
Creating useful parameters
Specifying type
Making parameters mandatory
Taking values from the pipeline
Switch parameters
Providing help for our script
Comments
Comment-based help
Write-Verbose
Parameter help messages
Chapter 9: Don't Repeat Yourself - Functions and Scriptblocks
Why do we care about repeating code?
How to turn repeating code into a function
What makes a function?
Function parameters
Filters
The concept of scope
Parent and child scopes
Scope modifiers
Exploring scriptblocks
How to run a scriptblock
Lambdas
Let's do something useful
Chapter 10: Error Handling - Oh No! It's Gone Wrong!
What is an error?
Terminating and non-terminating exceptions and errors
Understanding error actions
The ErrorActionPreference variable
The -ErrorAction parameter
Catching errors
Try/Catch/Finally
Creating errors
Exploring debugging
Script instrumentation
Debugging cmdlets
Debugging with VS Code
Chapter 11: Creating Our First Module
Working with modules
Module locations
Module autoloading
Importing modules
PowerShellGet
Writing a simple module
A word of caution - dot-sourcing.
Turning a script into a module
Nested modules
More modules
Module manifests
Using scaffolding tools such as Plaster
Chapter 12: Securing PowerShell
Why is security so important?
A PowerShell remoting whistlestop tour
Enabling PowerShell remoting
Creating a session
Joining and leaving a session
One-to-many sessions
Securing PowerShell against inadvertent mistakes
Execution policy
Other features
Running PowerShell securely
Application control
Language modes
Security servicing criteria
Software Bill of Materials
Windows Antimalware Scan Interface support
Secure Shell (SSH) remoting
Just Enough Administration
PowerShell logging
Over the shoulder logging
Deep script block logging
Module logging
Writing secure code
Storing passwords securely
Signing scripts
Parameter security
Part 3: Using PowerShell
Chapter 13: Working with PowerShell 7 and Windows
Understanding PowerShell 7 and Windows PowerShell
Exploring compatibility
Which modules are compatible with PowerShell 7?
What doesn't work with PowerShell 7
Managing machines with CIM and WMI
Introduction to CIM and WMI
Querying data
Making changes
Chapter 14: PowerShell 7 for Linux and macOS
Installing PowerShell 7
Installing PowerShell on Ubuntu 22.04
Installing PowerShell on CentOS 8 and 9
Installing PowerShell on CentOS 7
Running PowerShell on Linux
Remoting with OpenSSH
Checking that PowerShell has OpenSSH support
Installing OpenSSH on Windows
Installing OpenSSH on Linux
Running remote sessions
PowerShell for macOS
Installing Homebrew on macOS.
Installing PowerShell on macOS
Installing VS Code on macOS
Chapter 15: PowerShell 7 and the Raspberry Pi
Introduction to the Raspberry Pi
Installing PowerShell 7 and VS Code
Installing PowerShell
Connecting remotely to the Pi
Working with a headless Pi
Connecting to the Pi with PowerShell
Connecting to the Pi with VS Code
Running PowerShell on Raspberry Pi OS
Installing the IoT module
Exploring the IoT module
Simple physical computing
Questions
Chapter 16: Working with PowerShell and .NET
Exploring .NET
Software frameworks explained
Common language infrastructure
Common language runtime - CoreCLR
Framework Class Library - CoreFX
.NET history
The uses of .NET
The components of .NET
Assemblies
Types
Enumerations
Classes
Namespaces
Members
Versioning
Working with .NET in PowerShell
PowerShell assemblies
Dynamic assembly loading
Creating instances of types
Using .NET
An alternative to the Task Scheduler
Creating GUI objects
Answers to Activities and Exercises
Index
Other Books You May Enjoy.
Notes:
Description based upon print version of record.
Description based on publisher supplied metadata and other sources.
Description based on print version record.
ISBN:
9781801817493
1801817499
OCLC:
1423133189

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account