index

Symbols

[int] type 214, 301

* wildcard 30

*.log filename pattern 262

$_ placeholder 155156

$comp variable 268

$computer variable 283

$computer_to_query_for_data variable name 215

$computername variable 206, 208, 220, 239240

$computers variable 209210

$ConfirmPreference setting 80

$DebugContext variable 299

$Error automation variable 279

$ErrorActionPreference variable 280281

$filepath variable 239

$home built-in variable 298

$matches collection 265

$nestedpromptlevel variable 299

$number variable 213

$phrase variable 206

$process variable 216

$processes variable 211212

$processName variable 292

$properties variable 268

$props variable 272

$PSDefaultParameterValues variable 307

$pshome built-in variable 298

$PSVersionTable console type 6

$PSVersionTable variable 173

$session variable 235

$session01 variable 229, 231

$session02 variable 229

$sessions variable 228

$time variable 299

$VerbosePreference variable 256

A

action cmdlet 197

ActionPreferenceStopException object 281

actions 95

ActiveDirectory module 231232

Add keyword 153

Add() method 307308

advanced scripts 250

aliases 40, 4950, 253254

AliasProperty property 99

Alignment 143

AllSigned setting 45

-and operator 151

applications 48

arrays 40

artifacts 287

-as operator 142, 300301

-AsJob parameter 178179, 186

assignment operator 203

asynchronous multitasking 175

awk tool 53, 97

Az.* module 130

Az.Accounts module 130

Az.Storage module 128

Azure PowerShell 126

B

BackgroundColor parameter 220

bash command line utility 53

batch cmdlet 197

batch files 236237

breakpoint debugging 293295

breakpoints 293

brew cask install powershell command 12

Bypass setting 45

ByPropertyName parameter 119

ByPropertyName pipeline 119123

ByValue pipeline 116118

C

-ceq operator 149

-cge operator 149

-cgt operator 149

Change Directory command 62

[char] object type 214

child items 60

child jobs 182183

ChildItem noun 62

ChildJobs property 180

CI (continuous integration) 108

CIM (Common Information Model) 4, 188191

CimClassMethods property 189

-cle operator 150

Clear verb 61

Clear-Variable command 215

-clt operator 149

Cmdlet variety 88

[CmdletBinding()]directive 251

cmdlets 187188

enumerating objects 193194

modifying system with 7980

overview 48

typing names 5556

-cne operator 149

code $profile command 298

code command 16

collections 95

colors 299300

columns 141143

-Columns parameter 140

Command Explorer 17

command line 40

command line model, iterative 153155

commands 4257

adding 8493

command conflicts and removing extensions 90

confusion points 92

finding and adding modules 8789

finding and installing modules 8487

general discussion of 84

process of 9192

aliases 4950

anatomy of 4748

cmdlet naming convention 48

confusion points with 5556

typing cmdlet names 5556

typing parameters 56

differences between remote and local 168171

deserialized objects 168170

local vs. remote processing 170171

error messages 5455

examples in help system 37

external commands 5254

finding

task example 106107

with help system 2930

for managing jobs 183185

for working with variables 215

learning to use 108112

making repeatable 237238

parameterizing 238239

scripting vs. running commands 4647

security 4246

shortcuts 5052

truncating parameter names 50

using parameter name aliases 5051

using positional parameters 5152

comment-based help 243

-Common parameter 50

common parameters 51

Compare-Object command 76

comparison operators 150152

-Composite parameter 50

Compress-Archive command 9192

-ComputerName parameter 50, 129, 157, 233, 251, 253254, 257

-computername parameter 165, 227, 239, 253

ComputerName property 230

-Computers parameter 268

-Confirm parameter 59, 80

console host 218

-contains operator 302303

Continue variable 280

ConvertFrom cmdlet 73

ConvertFrom-Json cmdlet 73

ConvertFromDateTime() method 307

ConvertTo cmdlets 73

ConvertTo verb 78

ConvertTo- cmdlets 79

ConvertTo-CSV cmdlet 69

ConvertTo-HTML cmdlet 180

ConvertTo-Html command 114

ConvertTo-Json cmdlet 73, 110

ConvertTo-Xml cmdlet 79

ConvertToDateTime() method 307

Copy verb 61

-count parameter 70

CPU property 101, 103, 203

-Credential parameter 32, 59, 307

cross-platform remoting 158159

CSV file 7172

D

d alias 123

Data property 265

date manipulation 304306

Date String object 304

DateTime String object 304

[datetime] type 301

debugging techniques 287295

line by line 289293

output everything 287289

with breakpoints 293295

default formatting 132137

Delete() method 201

-Department parameter 124

dept property 124

-Descending parameter 101

deserialized objects 168170

-Difference parameter 75

-DifferenceObject parameter 75

Dir alias 64, 246

Dir command 70

disconnected sessions 233234

displaying information 218219

documenting script 241243

double quotes 211212

[double] type 214, 301

-drivetype parameter 253254

E

-EA SilentlyContinue command 281

early filtering, 149

Enable-PSRemoting cmdlet 163

EnableDHCP method 190191

endpoints 163

Enter-PSSession 164166, 226, 229231

enumerating objects 192194

enumerations 22

Env provider 59

Environment provider 59

Environment PSProvider 62

error messages 5455

ErrorAction common parameter 279

-ErrorAction parameter 50, 281, 284

errors 279, 282286

exceptions vs. 280281

handling badly 281282

handling exceptions 282284

for noncommands 284

going further with 284285

reasons for 282

ErrorVariable common parameter 283

ErrorVariable common parameter variable 279

-Example parameter 37

-Example switch 92

exceptions

errors vs. 280281

handling 282284

for noncommands 284

reasons for 282

execution policy 4346

-ExecutionPolicy command-line switch 43

Exit-PSSession 164166

-ExpandProperty parameter 128

Export verb 78

Export-Clixml cmdlet 74, 80

Export-CSV cmdlet 71, 74, 80, 82, 180

exporting pipeline data 7076

comparing files 7576

Out-File 74

to CSV 7172

to JSON 7273

to XML 74

Expression key 143, 308

Extensible Markup Language (XML) 74

extensions 90

external commands 5254

F

F8 debugging 290, 292

FileInfo object 118

-FilePath parameter 176

files

exporting pipeline to 7076

comparing files 7576

CSV 7172

JSON 7273

Out-File 74

XML 74

formatting output to 143

piping to 7778

filesystem

navigating 6263

organization of 6062

FileSystem provider 59, 62

FileSystem PSProvider 60

-Filter parameter 31, 3334, 59, 68

filtering 149156

$_ placeholder 155156

filtering left 150, 155

objects out of pipeline 152

overview 149

using comparison operators 150152

using iterative command-line model 153155

-FilterScript parameter 152, 308

folders 60

-Force switch 92

ForEach alias 200

ForEach loop 272, 283

ForEach-Object cmdlet 193194, 200

-ForegroundColor parameter 220

Format- cmdlets 143146, 148, 172

-Format-List cmdlet 180

Format-Table cmdlet 146

Format-Table parameter 139

Format-Wide cmdlet 140

FormatString 143

formatting 132148

confusion points 144148

always format right 145146

one type of object at time 146147

creating custom columns and list entries 141143

default formatting 132137

directing output

GridView 144

to file or to host 143

general discussion of 132

lists 139140

tables 137139

wide lists 140

full help 3435

-Full parameter 34, 37

-Full switch 92

full-form syntax of a command 47

func command-line utility 5354

functions 28, 48

G

gc alias 302

Get verb 48, 61, 156

Get- cmdlet 72

Get- commands 269

Get-AzContext command 130

Get-AzStorageBlob command 94

Get-AzSubscription command 130

Get-AzVm command 94

Get-ChildItem cmdlet 34, 123, 156, 239, 295

Get-CimClass command 189

Get-Command cmdlet 4748, 70, 74, 115, 156

Get-Credential command 307

Get-DNSClientCache cmdlet 265

get-help about_* command 38

Get-Help about_CommonParamaters command 51

Get-Help cmdlet 28, 97

Get-History -count 10 (or h) command 70

Get-Job cmdlet 48, 179

Get-LastOn command 271

Get-Location cmdlet 299

Get-Member command 9798

Get-Module command 86

Get-Noun cmdlet 48

Get-Process (or gps) command 70

Get-Process cmdlet 48, 50, 73, 94, 96, 114, 141, 156, 295

Get-User cmdlet 90

Get-Variable command 215

Get-WindowsFeature command 235

GetType() method 170

global scope 245

gm alias 98

go alias 123

GPO (Group Policy object) 43, 164

grep tool 53, 97

GridView 144

-GroupBy parameter 138, 148

H

Help command 34, 37, 48, 78, 247

Help keyword 28

help system 2541

accessing 38

accessing online help 3839

asking for help 2829

finding commands with 2930

interpreting help 3137

finding command examples 37

optional and mandatory parameters 3233

parameter sets and common parameters 3132

parameter values 3537

positional parameters 3335

overview 2526

updatable help 2728

host 77, 135

host alias 257

host application 218

host, formatting output to 143

hostname alias 257

-HostName parameter 157, 165, 168, 227

HTML, converting pipeline to 7879

I

ID property 99, 103

Id property 150, 203

Id property name 192

IdleTimeout 234

if statement 272

ifconfig command-line utility 52

implicit remoting 226, 231233

Import- cmdlets 81

Import-Clixml cmdlet 74

Import-CSV cmdlet 74

import-excel module 93

importing sessions 231233

-in operator 302303

-Include parameter 68

-IncludeTypeInformation parameter 83

-IncludeTypeInformation switch 81

IndexOf() String method 304

input 218225

other ways to write 223224

prompting for information 218219

Read-Host 219220

Write-Host 220221

Write-Output 222223

Install-Module -Name Az command 86

installing

PowerShell 67

Linux (Ubuntu 18.04) 14

macOS 1213

Visual Studio Code and PowerShell extension 1516

Integrated Console 17

integrated host 218

Invoke-CimMethod generic cmdlet 189

-Invoke-Command cmdlet 226, 231

Invoke-ScriptBlock 167168

ipconfig command line utility 48, 52

-is operator 300301

Item cmdlets 6364

Item noun 61

ItemProperty noun 62

iterative command-line model 153155

J

-JobName parameter 177

jobs 174186

commands for managing jobs 183185

confusion points 185186

creating process job 175176

creating thread job 176177

getting job results 179182

multitasking in PowerShell 174

remoting as 177

synchronous vs. asynchronous 175

working with child jobs 182183

-join operator 301302, 304

Join() String method 304

JSON (JavaScript Object Notation) 19, 7273

K

KeyHandler object 135

Kill() method 100, 198199, 201

kills terminals 17

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, 289293

Linux

PowerShell 3

remoting on 158

SSH (Secure Shell) on 159160

Linux (Ubuntu 18.04) 1314

-ListAvailable parameter 86

lists

creating custom entries 141143

formatting 139140

literal paths 6364

-LiteralPath parameter 31, 64

login property 124

M

macOS 3, 1213

remoting on 158

SSH (Secure Shell) on 159160

mandatory parameters 3233, 251253

-Match operator 262, 265

MatchInfo object 263

MaxConcurrentUsers 234

MaxConnections 234

-MaxEvents parameter 271

MaxShellRunTime 234

MaxShellsPerUser 234

Measure keyword 153

Measure-Command cmdlet 194

MemberDefinition object 104

members 98

Message property 263264

methods 100

documentation 199200

invoking 188191

unrolling in PowerShell 210211

Microsoft.PowerShell.Archive command 117

Microsoft.PowerShell.KeyHandler objects 135

mkdir command 63

-Module parameter 47, 126, 131

modules 84

adding 8789

installing 8487

more command 70

Move verb 61

Move-AdObject cmdlet 187

Move-Item cmdlet 187

multitasking 174186

commands for managing jobs 183185

confusion points 185186

creating process job 175176

creating thread job 176177

getting job results 179182

PowerShell and 174

remoting, as job 177

synchronous vs. asynchronous 175

working with child jobs 182183

My Variable variable 204

N

Name key 143

-Name parameter 67, 83, 116121, 156, 176, 192, 194

Name property 103, 119, 121, 123124, 129, 140141, 203, 210

nested property 72

New verb 48, 61

New-ADUser command 123

New-AzKeyVault cmdlet 193

New-AzVm command 178

New-Item cmdlet 57, 63

New-PSSession cmdlet 227, 282283

New-Variable command 215

-not operator 151

NoteProperty property 99

nslookup command-line utility 52

O

objects 40, 94105, 187201

Common Information Model (CIM) way 188191

confusion points 104, 197200

diminishing returns of Parallel ForEach 198199

ForEach-Object 200

method documentation 199200

defined 9495

deserialized 168170

Enter-PSSession with session 229231

enumerating 192194

filtering out of pipeline 152

formatting one type at time 146147

Get-Member command 9798

Invoke-Command with session 231

methods 100

PowerShell using 9597

properties 99

saving time 194197

selecting properties 101102

sorting 100101

storing in variables 207211

multiple objects in variable 209

other ways to work with multiple objects 209210

single objects in variable 207208

unrolling properties and methods in PowerShell 210211

until end 102104

one-to-many remoting 167168

one-to-one remoting 164166

online help 3839

-Online parameter 34, 38

operators 300303

-as and -is 300301

-contains and -in 302303

-join and -split 301302

-replace 301

optional parameters 3233

-or operator 151

Out- cmdlets 7778, 135, 137, 143, 145146

Out-Default cmdlet 77, 134, 152

Out-File cmdlet 40, 74, 103, 146, 180

Out-File procs.html command 114

Out-GridView cmdlet 144

out-of-scope variable 215

output 218225

debugging techniques 287289

formatting

GridView 144

to file or to host 143

other ways to write 223224

prompting for information 218219

Read-Host 219220

Write-Host 220221

Write-Output 222223

P

Parallel ForEach 198199

Param() block 240241, 247

parameter block 268

parameter sets 31

parameter values 3537, 307308

parameterized script 240241, 249258

adding parameter aliases 253254

making parameters mandatory 251253

starting point 249250

using PowerShell 250251

validating parameter input 254255

verbose output 255257

parameterizing commands 238239

parameters

optional and mandatory parameters 3233

parameter sets 3132

parameterized script

adding parameter aliases 253254

making mandatory 251253

validating parameter input 254255

positional parameters 3335

finding in full help 3435

finding in syntax summary 3334

shortcuts with

truncating parameter names 50

using parameter name aliases 5051

using positional parameters 5152

typing 56

parenthetical commands 126127

-PassThru parameter 188

-Path parameter 3134, 51, 6364, 92, 149, 239, 307

path parameter 239

PATH variable 68

Pause verb 48

ping command line utility 48, 5253

pipelines 83, 114, 131

confusion points 8082

converting to HTML 7879

custom properties 123126

enabling power with less typing 114

exporting to file 7076

comparing files 7576

Out-File 74

to CSV 7172

to JSON 7273

to XML 74

extracting value from single property 127129

input ByPropertyName 119123

input ByValue 116118

killing processes 7980

overview 6970

parenthetical commands 126127

piping to file 7778

PowerShell passing data down 114116

script and 243245

working with Azure PowerShell 126

PM property 203

positional parameters 3335

finding in full help 3435

finding in syntax summary 3334

shortcuts 5152

PowerShell 124

advantages of 13

audiences using 34

being immediately effective with 7

installing 67

multitasking and 174

on Linux 3

on Linux (Ubuntu 18.04) 1314

on macOS 3, 1213

on Windows 3, 12

passing data down pipeline 114116

profiles 296298

resources for help 7

setting up lab environment 6

typing 2122

using objects 9597

version, determining 23

Visual Studio Code and PowerShell extension 1421

customizing 1821

installing 1516

overview 1618

PowerShell extension 1421

customizing 1821

installing 1516

overview 1618

PowerShell script 46

private scope 245

process block 268

process job 175176

Process objects 156, 243245

-Process parameter 194, 308

processing, local vs. remote 170171

ProcessName column 97

profile scripts 296

prompt

customizing 298299

for information 218219

Prompt function 298

properties

custom pipeline 123126

extracting value from single property 127129

objects

overview 99

selecting 101102

unrolling in PowerShell 210211

-Property parameter 7576, 101, 125, 138140

providers 5868

filesystem

navigating 6263

organization of 6062

overview 5860

wildcards and literal paths 6364

working with other providers 6467

PSComputerName property 181

PSDrive 59

PSModulePath environment variable 8788

PSProvider 58

PSReadLine module 156

PSResourceGroup object 128

PSRP (PowerShell remoting protocol) 159161

macOS and Linux 159160

on Windows 160161

overview 161162

PSSession object 230

PSVersion property 173

pwsh command 12, 14

pwsh process 171

Q

quotes, tricks with 205207

R

Read-Host cmdlet 219220

Receive-Job cmdlet 79

-Recurse parameter 56

-ReferenceObject parameter 69, 75

regex (regular expressions) 259265

purpose of 259260

syntax primer 260261

with -Match 262

with Select-String 262264

rem prefix 232, 235

remote control 157173

as job 177

confusion points 172

differences between remote and local commands 168171

deserialized objects 168170

local vs. remote processing 170171

idea behind 157159

cross-platform remoting 158159

remoting on macOS and Linux devices 158

remoting on Windows devices 158

PSRP over standard Secure Shell (SSH) 159162

macOS and Linux 159160

on Windows 160161

sessions 226235

creating and using reusable 227228

Enter-PSSession with session objects 229231

importing 231233

Invoke-Command with session objects 231

using disconnected 233234

using Enter-PSSession and Exit-PSSession for one-to-one remoting 164166

using Invoke-ScriptBlock for one-to-many remoting 167168

WinRM 162164

remote scripts 45

Remote Server Administration Tools (RSAT) 123, 231

RemoteSigned setting 45

remoting 157

remoting chain 166

Remove verb 61

Remove-Item command 215, 281

Remove-Job cmdlet 183

Remove-PSSession cmdlet 227

Remove-Variable command 215

Rename verb 61

-replace operator 301, 304

Replace() method 208

-ResourceGroupName parameter 128129

resources 312

Responding property 148

Restricted setting 45

ReturnValue number 191

reusable sessions 227228

risk mitigation parameters 38

RSAT (Remote Server Administration Tools) 123, 231

S

samAccountName property 124

scopes 245247

script blocks 308309

Script editor pane 17

script scope 245

-ScriptBlock parameter 168, 175, 308

scripting 236248

batch files 236237

creating parameterized script 240241

documenting script 241243

making commands repeatable 237238

one script and one pipeline 243245

other people's scripts 266272

line-by-line examination 269

parameter block 268

process block 268

parameterizing commands 238239

running commands vs. 4647

scopes 245247

scripting language 46

ScriptProperty property 99

scripts 46, 236, 238

Secrets of PowerShell Remoting (Jones & Weltner) 173

security 4246

sed tool 53, 97

sel alias 123

Selecet-AZSubscription command 130

Select-Object -Property Name command 129

Select-Object cmdlet 101102, 123, 128

Select-String command 262264

selected objects 103104

ServerManager module 235

session configurations 163

-session parameter 230231

sessions 226235

creating and using reusable 227228

Enter-PSSession with session objects 229231

importing 231233

Invoke-Command with session objects 231

using disconnected 233234

Set verb 48, 61

Set-ExecutionPolicy command 43

Set-Location cmdlet 62

Set-Service cmdlet 187

Set-Variable command 215

Set-WSManQuickConfig cmdlet 163

shells 46

shortcuts 5052

truncating parameter names 50

using parameter name aliases 5051

using positional parameters 5152

ShouldProcess 59

[single] type 214, 301

snap install powershell – -classic command 14

Sort-Object cmdlet 101102, 180

Sort-Object VM -desc command 114

sorting objects 100101

-Source parameter 28

-Split operator 272, 301302, 304

Split() String method 304

spooler service 283

SSH (Secure Shell) 159161

macOS and Linux 159160

on Windows 160161

overview 161162

sshd_config file 160

Start method 199

Start-Job cmdlet 48, 175, 308

Start-Process cmdlet 187

Stop error action 281

Stop-Job cmdlet 7980, 183

Stop-Process cmdlet 48, 80, 201

strComputerName variable name 204

-Stream parameter 33

String input 35

string manipulation 303304

String methods 304

String object 116, 118, 126128, 155, 203, 210, 304

string replace() method 301

[string] type 214, 301

String types 207

String. Get-Module type 118

subexpressions 212

-Subscription parameter 130131

-SubscriptionName parameter 130

Sum keyword 153

summary help 30

Switch scripting construct 265

switches 36

synchronous multitasking 175

-Syntax parameter 47

System.Diagnostics.Process object 103, 168

System.String object 203

System.String type 116, 203, 208

System.Uri object 137

System.Uri type 135

T

table columns 95

table rows 95

table view 133

tables 137139

task example 106113

defining 106

finding commands 106107

learning to use commands 108112

tips for teaching oneself 112

terminating exception 282

Test-Connection cmdlet 53

text parsing with regex 259265

purpose of 259260

syntax primer 260261

with -Match 262

with Select-String 262264

third formatting rule 137

thread job 176177

Threads property 7273

throttle limit 196

-ThrottleLimit parameter 167, 177, 196

TimeSpan objects 244245

tips 296 – 309

customizing prompt 298299

date manipulation 304306

operators 300303

-as and -is 300301

-contains and -in 302303

-join and -split 301 – 302

-replace 301

PowerShell profiles 296298

script blocks 308309

setting default parameter values 307308

string manipulation 303304

tweaking colors 299300

WMI dates 306307

ToLower() method 208210, 304

tool making 310

ToString() method 170

ToUpper() method 208, 304

Trim() String method 304

TrimEnd() String method 304

TrimStart() String method 304

type alias 81

typing 2122, 114

U

Unrestricted setting 4546

updatable help 2728

Update-Help command 88

-UseTransaction parameters 62

V

Value property 123

values 202205

var variable name 203, 205

variables 202217

best practices 215216

commands for working with 215

confusion points 216

declaring type of 212215

overview 202

storing objects in 207211

multiple objects in variable 209

other ways to work with multiple objects 209210

single objects in variable 207208

unrolling properties and methods in PowerShell 210211

storing values in 202 – 205

tricks with

double quotes 211212

quotes 205207

verb-noun naming convention 48

verbose output 255257

-Verbose parameter 256

-Verbose switch 92

version, determining 23

Visual Studio Code 1421

customizing 1821

installing 1516

overview 1618

VM property 141, 203

W

Wait-Job cmdlet 79, 183

Weltner, Tobias 173

-WhatIf parameter 59, 80

where alias 150

Where verb 48

Where-Object cmdlet 102, 150, 152

wide lists 140

-Width parameter 143

wildcards 6364

Win32_LogicalDisk WMI class 254

Win32_NetworkAdapterConfiguration CIM class 188

Win32_NetworkAdapterConfiguration objects 190

Win32_OperatingSystem class 306

Windows

PowerShell 3

PowerShell on 9

remoting on 158

SSH (Secure Shell) on 160161

Windows Registry 6567

WinRM (Windows Remote Management) 158, 162164

WMI dates 306307

-WorkingDirectory parameter 176

WorkingSet property 152, 156

-Wrap parameter 139

Write alias 222

Write command 246

Write-* statements 287

Write-Debug cmdlet 224

Write-Error cmdlet 224

Write-Host cmdlet 220221

Write-Information cmdlet 221, 224

Write-Output 222223

Write-Progress cmdlet 224

Write-Verbose cmdlet 221, 224

Write-Warning cmdlet 224

WSMan (Web Services for Management) 158

X

XML (Extensible Markup Language) 74

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.29.238