Table of Contents
Learn PowerShell in a Month of Lunches Index
Symbols
- wildcard 30
$_ placeholder 155 – 156
$comp variable 268
$computer variable 283
$computer_to_query_for_data variable name 215
$computername variable 206, 208, 220, 239 – 240
$computers variable 209 – 210
$Error automation variable 279
$ErrorActionPreference variable 280 – 281
$filepath variable 239
$home built-in variable 298
$matches collection 265
$nestedpromptlevel variable 299
$number variable 213
$process variable 216
$processName variable 292
$properties variable 268
$PSDefaultParameterValues variable 307
$pshome built-in variable 298
$PSVersionTable console type 6
$session variable 235
$time variable 299
A
action cmdlet 197
ActionPreferenceStopException object 281
actions 95
ActiveDirectory module 231 – 232
Add keyword 153
aliases 40, 49 – 50, 253 – 254
Alignment 143
-and operator 151
applications 48
arrays 40
artifacts 287
-as operator 142, 300 – 301
-AsJob parameter 178 – 179, 186
Azure PowerShell 126
B
breakpoint debuging 293 – 295
breakpoints 293
brew cask install powershell command 12
ByPropertyName pipeline 119 – 123
C
child items 60
CI (continuous integration) 108
CIM (Common Information Model) 4, 188 – 191
-cle operator 150
-clt operator 149
Cmdlet variety 88
[CmdletBinding()]directive 251
cmdlets 187 – 188
enumerating objects 193 – 194
overview 48
-cne operator 149
collections 95
colors 299 – 300
columns 141 – 143
command line 40
command line model, iterative 153 – 155
commands 42 – 57
adding 84 – 93
command conflicts and removing extensions 90
finding and adding modules 87 – 89
finding and installing modules 84 – 87
process of 91 – 92
aliases 49 – 50
anatomy of 47 – 48
differences between remote and local 168 – 171
deserialized objects 168 – 170
local vs. remote processing 170 – 171
error messages 54 – 55
for working with variables 215
learning to use 108 – 112
making repeatable 237 – 238
parameterizing 238 – 239
scripting vs. running commands 46 – 47
security 42 – 46
shortcuts 50 – 52
using parameter name aliases 50 – 51
using positional parameters 51 – 52
comparison operators 150 – 152
Compress-Archive command 91 – 92
-ComputerName parameter 50, 129, 157, 233, 251, 253 – 254, 257
-computername parameter 165, 227, 239, 253
ComputerName property 230
ConvertFromDateTime() method 307
ConvertToDateTime() method 307
-Credential parameter 32, 59, 307
cross-platform remoting 158 – 159
CSV file 71 – 72
D
d alias 123
date manipulation 304 – 306
with breakpoints 293 – 295
default formatting 132 – 137
-Department parameter 124
dept property 124
-Descending parameter 101
deserialized objects 168 – 170
-Difference parameter 75
-DifferenceObject parameter 75
disconnected sessions 233 – 234
displaying information 218 – 219
-drivetype parameter 253 – 254
E
-EA SilentlyContinue command 281
endpoints 163
Enter-PSSession 164 – 166, 226, 229 – 231
enumerating objects 192 – 194
enumerations 22
error messages 54 – 55
ErrorAction common parameter 279
-ErrorAction parameter 50, 281, 284
errors 279, 282 – 286
handling badly 281 – 282
for noncommands 284
going further with 284 – 285
reasons for 282
ErrorVariable common parameter 283
ErrorVariable common parameter variable 279
handling 282 – 284
for noncommands 284
reasons for 282
-ExecutionPolicy command-line switch 43
Export-CSV cmdlet 71, 74, 80, 82, 180
exporting pipeline data 70 – 76
Out-File 74
to CSV 71 – 72
to JSON 72 – 73
to XML 74
Expression key 143, 308
Extensible Markup Language (XML) 74
extensions 90
F
files
CSV 71 – 72
JSON 72 – 73
Out-File 74
XML 74
formatting output to 143
piping to 77 – 78
navigating 62 – 63
organization of 60 – 62
FileSystem provider 59, 62
-Filter parameter 31, 33 – 34, 59, 68
filtering 149 – 156
$_ placeholder 155 – 156
overview 149
using comparison operators 150 – 152
using iterative command-line model 153 – 155
-FilterScript parameter 152, 308
folders 60
ForEach-Object cmdlet 193 – 194, 200
-ForegroundColor parameter 220
Format- cmdlets 143 – 146, 148, 172
formatting 132 – 148
one type of object at time 146 – 147
creating custom columns and list entries 141 – 143
default formatting 132 – 137
GridView 144
lists 139 – 140
tables 137 – 139
full help 34 – 35
-Full parameter 34, 37
-Full switch 92
full-form syntax of a command 47
func command-line utility 53 – 54
functions 28, 48
G
gc alias 302
Get-AzSubscription command 130
Get-ChildItem cmdlet 34, 123, 156, 239, 295
Get-Command cmdlet 47 – 48, 70, 74, 115, 156
Get-Help about_CommonParamaters command 51
Get-History -count 10 (or h) command 70
Get-Member command 97 – 98
Get-Process (or gps) command 70
Get-Process cmdlet 48, 50, 73, 94, 96, 114, 141, 156, 295
Get-WindowsFeature command 235
global scope 245
gm alias 98
GPO (Group Policy object) 43, 164
grep tool 53, 97
GridView 144
H
Help command 34, 37, 48, 78, 247
accessing 38
asking for help 28 – 29
interpreting help 31 – 37
optional and mandatory parameters 32 – 33
parameter sets and common parameters 31 – 32
overview 25 – 26
host 77, 135
host application 218
host, formatting output to 143
-HostName parameter 157, 165, 168, 227
HTML, converting pipeline to 78 – 79
I
Id property name 192
if statement 272
ifconfig command-line utility 52
implicit remoting 226, 231 – 233
-in operator 302 – 303
-IncludeTypeInformation parameter 83
-IncludeTypeInformation switch 81
input 218 – 225
other ways to write 223 – 224
prompting for information 218 – 219
Write-Host 220 – 221
Write-Output 222 – 223
Install-Module -Name Az command 86
PowerShell 6 – 7
macOS 12 – 13
Visual Studio Code and PowerShell extension 15 – 16
integrated host 218
Invoke-CimMethod generic cmdlet 189
-Invoke-Command cmdlet 226, 231
ipconfig command line utility 48, 52
-is operator 300 – 301
iterative command-line model 153 – 155
J
jobs 174 – 186
commands for managing jobs 183 – 185
creating process job 175 – 176
multitasking in PowerShell 174
remoting as 177
synchronous vs. asynchronous 175
working with child jobs 182 – 183
JSON (JavaScript Object Notation) 19, 72 – 73
K
L
Learn PowerShell Toolmaking in a Month of Lunches (Jones and Hicks) 108
Length property 148, 208, 210, 223
-like operator 302
line-by-line examination 269, 289 – 293
remoting on 158
SSH (Secure Shell) on 159 – 160
lists
creating custom entries 141 – 143
formatting 139 – 140
M
macOS 3, 12 – 13
remoting on 158
SSH (Secure Shell) on 159 – 160
mandatory parameters 32 – 33, 251 – 253
MaxConcurrentUsers 234
MaxConnections 234
members 98
methods 100
documentation 199 – 200
invoking 188 – 191
unrolling in PowerShell 210 – 211
Microsoft.PowerShell.Archive command 117
Microsoft.PowerShell.KeyHandler objects 135
mkdir command 63
-Module parameter 47, 126, 131
modules 84
adding 87 – 89
installing 84 – 87
more command 70
Move verb 61
multitasking 174 – 186
commands for managing jobs 183 – 185
creating process job 175 – 176
PowerShell and 174
synchronous vs. asynchronous 175
N
-Name parameter 67, 83, 116 – 121, 156, 176, 192, 194
Name property 103, 119, 121, 123 – 124, 129, 140 – 141, 203, 210
New verb 48, 61
New-PSSession cmdlet 227, 282 – 283
New-Variable command 215
-not operator 151
O
objects 40, 94 – 105, 187 – 201
Common Information Model (CIM) way 188 – 191
confusion points 104, 197 – 200
diminishing returns of Parallel ForEach 198 – 199
method documentation 199 – 200
defined 94 – 95
deserialized 168 – 170
Enter-PSSession with session 229 – 231
enumerating 192 – 194
formatting one type at time 146 – 147
Get-Member command 97 – 98
Invoke-Command with session 231
methods 100
PowerShell using 95 – 97
properties 99
selecting properties 101 – 102
sorting 100 – 101
storing in variables 207 – 211
multiple objects in variable 209
other ways to work with multiple objects 209 – 210
single objects in variable 207 – 208
unrolling properties and methods in PowerShell 210 – 211
until end 102 – 104
one-to-many remoting 167 – 168
one-to-one remoting 164 – 166
operators 300 – 303
-as and -is 300 – 301
-contains and -in 302 – 303
-replace 301
-or operator 151
Out- cmdlets 77 – 78, 135, 137, 143, 145 – 146
Out-Default cmdlet 77, 134, 152
Out-File cmdlet 40, 74, 103, 146, 180
Out-File procs.html command 114
out-of-scope variable 215
output 218 – 225
GridView 144
other ways to write 223 – 224
prompting for information 218 – 219
Write-Host 220 – 221
Write-Output 222 – 223
P
Param() block 240 – 241, 247
parameter values 35 – 37, 307 – 308
parameterized script 240 – 241, 249 – 258
adding parameter aliases 253 – 254
making parameters mandatory 251 – 253
using PowerShell 250 – 251
validating parameter input 254 – 255
parameterizing commands 238 – 239
optional and mandatory parameters 32 – 33
adding parameter aliases 253 – 254
making mandatory 251 – 253
validating parameter input 254 – 255
finding in syntax summary 33 – 34
shortcuts with
using parameter name aliases 50 – 51
using positional parameters 51 – 52
typing 56
parenthetical commands 126 – 127
-Path parameter 31 – 34, 51, 63 – 64, 92, 149, 239, 307
ping command line utility 48, 52 – 53
pipelines 83, 114, 131
converting to HTML 78 – 79
custom properties 123 – 126
enabling power with less typing 114
Out-File 74
to CSV 71 – 72
to JSON 72 – 73
to XML 74
extracting value from single property 127 – 129
input ByPropertyName 119 – 123
overview 69 – 70
parenthetical commands 126 – 127
PowerShell passing data down 114 – 116
script and 243 – 245
working with Azure PowerShell 126
PM property 203
finding in syntax summary 33 – 34
shortcuts 51 – 52
PowerShell 1 – 24
advantages of 1 – 3
audiences using 3 – 4
being immediately effective with 7
installing 6 – 7
multitasking and 174
on Linux 3
on Linux (Ubuntu 18.04) 13 – 14
on macOS 3, 12 – 13
on Windows 3, 12
passing data down pipeline 114 – 116
profiles 296 – 298
typing 21 – 22
using objects 95 – 97
version, determining 23
Visual Studio Code and PowerShell extension 14 – 21
customizing 18 – 21
installing 15 – 16
overview 16 – 18
PowerShell extension 14 – 21
customizing 18 – 21
installing 15 – 16
overview 16 – 18
PowerShell script 46
Process objects 156, 243 – 245
processing, local vs. remote 170 – 171
customizing 298 – 299
for information 218 – 219
extracting value from single property 127 – 129
overview 99
selecting 101 – 102
unrolling in PowerShell 210 – 211
-Property parameter 75 – 76, 101, 125, 138 – 140
providers 58 – 68
navigating 62 – 63
organization of 60 – 62
overview 58 – 60
wildcards and literal paths 63 – 64
working with other providers 64 – 67
PSModulePath environment variable 87 – 88
PSRP (PowerShell remoting protocol) 159 – 161
on Windows 160 – 161
overview 161 – 162
pwsh command 12, 14
pwsh process 171
Q
R
-ReferenceObject parameter 69, 75
regex (regular expressions) 259 – 265
purpose of 259 – 260
with -Match 262
rem prefix 232, 235
as job 177
differences between remote and local commands 168 – 171
deserialized objects 168 – 170
local vs. remote processing 170 – 171
idea behind 157 – 159
cross-platform remoting 158 – 159
remoting on macOS and Linux devices 158
remoting on Windows devices 158
PSRP over standard Secure Shell (SSH) 159 – 162
on Windows 160 – 161
sessions 226 – 235
creating and using reusable 227 – 228
Enter-PSSession with session objects 229 – 231
importing 231 – 233
Invoke-Command with session objects 231
using disconnected 233 – 234
using Enter-PSSession and Exit-PSSession for one-to-one remoting 164 – 166
using Invoke-ScriptBlock for one-to-many remoting 167 – 168
WinRM 162 – 164
Remote Server Administration Tools (RSAT) 123, 231
remoting 157
-ResourceGroupName parameter 128 – 129
resources 312
Responding property 148
ReturnValue number 191
risk mitigation parameters 38
RSAT (Remote Server Administration Tools) 123, 231
S
scopes 245 – 247
-ScriptBlock parameter 168, 175, 308
scripting 236 – 248
creating parameterized script 240 – 241
making commands repeatable 237 – 238
one script and one pipeline 243 – 245
other people's scripts 266 – 272
line-by-line examination 269
parameterizing commands 238 – 239
scopes 245 – 247
scripts 46, 236, 238
Secrets of PowerShell Remoting (Jones & Weltner) 173
security 42 – 46
sed tool 53, 97
sel alias 123
Selecet-AZSubscription command 130
Select-Object -Property Name command 129
Select-Object cmdlet 101 – 102, 123, 128
Select-String command 262 – 264
session configurations 163
sessions 226 – 235
creating and using reusable 227 – 228
Enter-PSSession with session objects 229 – 231
importing 231 – 233
Invoke-Command with session objects 231
using disconnected 233 – 234
Set-ExecutionPolicy command 43
Set-WSManQuickConfig cmdlet 163
shells 46
shortcuts 50 – 52
using parameter name aliases 50 – 51
using positional parameters 51 – 52
snap install powershell – -classic command 14
Sort-Object cmdlet 101 – 102, 180
Sort-Object VM -desc command 114
-Split operator 272, 301 – 302, 304
SSH (Secure Shell) 159 – 161
on Windows 160 – 161
overview 161 – 162
Stop-Process cmdlet 48, 80, 201
strComputerName variable name 204
string manipulation 303 – 304
String object 116, 118, 126 – 128, 155, 203, 210, 304
subexpressions 212
-Subscription parameter 130 – 131
-SubscriptionName parameter 130
Switch scripting construct 265
switches 36
System.Diagnostics.Process object 103, 168
T
tables 137 – 139
defining 106
learning to use commands 108 – 112
terminating exception 282
Test-Connection cmdlet 53
text parsing with regex 259 – 265
purpose of 259 – 260
with -Match 262
third formatting rule 137
throttle limit 196
-ThrottleLimit parameter 167, 177, 196
tips 296 – 309
date manipulation 304 – 306
operators 300 – 303
-as and -is 300 – 301
-contains and -in 302 – 303
-replace 301
PowerShell profiles 296 – 298
setting default parameter values 307 – 308
string manipulation 303 – 304
WMI dates 306 – 307
ToLower() method 208 – 210, 304
tool making 310
type alias 81
typing 21 – 22, 114
U
-UseTransaction parameters 62
V
values 202 – 205
var variable name 203, 205
variables 202 – 217
best practices 215 – 216
overview 202
multiple objects in variable 209
other ways to work with multiple objects 209 – 210
single objects in variable 207 – 208
unrolling properties and methods in PowerShell 210 – 211
tricks with
quotes 205 – 207
verb-noun naming convention 48
version, determining 23
Visual Studio Code 14 – 21
customizing 18 – 21
installing 15 – 16
overview 16 – 18
W
where alias 150
Where verb 48
Where-Object cmdlet 102, 150, 152
wildcards 63 – 64
Win32_LogicalDisk WMI class 254
Win32_NetworkAdapterConfiguration CIM class 188
Win32_NetworkAdapterConfiguration objects 190
Win32_OperatingSystem class 306
PowerShell on 9
remoting on 158
SSH (Secure Shell) on 160 – 161
Windows Registry 65 – 67
WinRM (Windows Remote Management) 158, 162 – 164
WMI dates 306 – 307
-WorkingDirectory parameter 176
WorkingSet property 152, 156
Write alias 222
Write command 246
Write-Debug cmdlet 224
Write-Error cmdlet 224
Write-Host cmdlet 220 – 221
Write-Information cmdlet 221, 224
Write-Output 222 – 223
Write-Progress cmdlet 224
Write-Verbose cmdlet 221, 224
Write-Warning cmdlet 224
X
PowerShell: PowerShell Fundamentals - PowerShell Basic Commands, PowerShell Inventor - PowerShell Language Designer: Jeffrey Snover, Bruce Payette, James Truher (et al.) of Microsoft on November 14, 2006; PowerShell DevOps - PowerShell SRE, PowerShell in the Cloud (Azure PowerShell - AWS PowerShell - GCP PowerShell - VMware PowerShell), PowerShell Core, Windows PowerShell, Windows Server PowerShell, Linux PowerShell (PowerShell on Ubuntu, PowerShell on Debian, PowerShell on RHEL, PowerShell on Fedora - brew install powershell), macOS PowerShell - brew install powershell, Cloud Native PowerShell - PowerShell on Kubernetes - PowerShell on AWS - PowerShell on Azure - PowerShell on GCP), PowerShell Microservices, PowerShell Containerization (PowerShell Docker - PowerShell on Docker Hub), Serverless PowerShell, PowerShell Data Science - PowerShell DataOps - PowerShell and Databases (PowerShell ORM), PowerShell ML - PowerShell DL, Functional PowerShell (1. PowerShell Immutability, 2. PowerShell Purity - PowerShell No Side-Effects, 3. PowerShell First-Class Functions - PowerShell Higher-Order Functions, PowerShell Lambdas - PowerShell Anonymous Functions - PowerShell Closures, PowerShell Lazy Evaluation, 4. PowerShell Recursion), Reactive PowerShell), PowerShell Concurrency - PowerShell Parallel Programming - Async PowerShell, PowerShell Networking, PowerShell Security - PowerShell DevSecOps - PowerShell OAuth, PowerShell Memory Allocation (PowerShell Heap - PowerShell Stack - PowerShell Garbage Collection), PowerShell CI/CD - PowerShell Dependency Management - PowerShell DI - PowerShell IoC - PowerShell Build Pipeline, PowerShell Automation - PowerShell Scripting, PowerShell Package Managers, PowerShell Modules - PowerShell Packages, PowerShell Installation (PowerShell Windows - Chocolatey PowerShell (choco search powershell, choco install powershell-core), PowerShell macOS - Homebrew PowerShell, PowerShell on Linux), PowerShell Configuration, PowerShell Observability (PowerShell Monitoring, PowerShell Performance - PowerShell Logging), PowerShell Language Spec - PowerShell RFCs - PowerShell Roadmap, PowerShell Keywords, PowerShell Data Structures - PowerShell Algorithms, PowerShell Syntax, PowerShell OOP (1. PowerShell Encapsulation - 2. PowerShell Inheritance - 3. PowerShell Polymorphism - 4. PowerShell Abstraction), PowerShell Design Patterns - PowerShell Best Practices - PowerShell Style Guide - Clean PowerShell - PowerShell BDD, PowerShell Generics, PowerShell I/O, PowerShell Serialization - PowerShell Deserialization, PowerShell APIs, PowerShell REST - PowerShell JSON - PowerShell GraphQL, PowerShell gRPC, PowerShell Virtualization, PowerShell Development Tools: PowerShell SDK, PowerShell Compiler - PowerShell Transpiler, PowerShell Interpreter - PowerShell REPL, PowerShell IDEs (JetBrains PowerShell, PowerShell Visual Studio Code), PowerShell Linter, PowerShell Community - PowerShellaceans - PowerShell User, PowerShell Standard Library - PowerShell Libraries - PowerShell Frameworks, PowerShell Testing - PowerShell TDD, PowerShell History, PowerShell Versions, PowerShell Research, PowerShell Topics, PowerShell Uses - List of PowerShell Software - Written in PowerShell - PowerShell Popularity, PowerShell Bibliography - Manning PowerShell Series - PowerShell Courses, PowerShell Glossary - PowerShell Official Glossary, PowerShell GitHub, Awesome PowerShell, PowerShell Versions. (navbar_powershell)
© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.