Symbols
-and operator 109
-as operator 116
-isnot operator 117
-is operator 117
-join operator 125
-not (or !) operator 110
-or operator 109
-Skip command
using 659
-xor operator 109
A
Abstract Syntax Tree (AST) 225, 634
acceptance testing
performing, considerations 650
access 286
Access Control Entries (ACEs) 287
adding 292
access control entry (ACE)
Access Control Lists (ACLs) 286
access mask 290
access modifier 62
Action parameter 437, 438, 439
Adapted Type System (ATS) 60
add and assign operator (+=) 98
addition operators 94
Add-Member command 65
Alias attribute 505
alternation 255
restricting 256
any character (.) 243
Argument Completer attribute 554, 555
Register-ArgumentCompleter, using 555, 556
registered argument completers, listing 557
ArgumentTypeConverterAttribute type 208, 209, 210, 211
precedence 94
array 147
clearing 154
creating 148
elements, removing 152
elements, removing by index 153, 154
elements, removing by value 154
element value, changing 152
multi-dimensional arrays 155, 156
variables, filling 155
array operator
used, for breaking up lines 517, 518
array parameter 174
arrays 223
reference link 652
assign and divide operator 99
assignment operators 97
add and assign operator (+=) 98
assign 97
multiply and assign operator 99
subtract and assign operator (-=) 99
ASSOCIATORS OF
ATS and ETS, Microsoft
reference link 61
audit 287
authentication
working with 380
B
background operator 432
badssl site
URL 371
Base64 230
begin block 507
binary and (-band) operator 111
binary exclusive or (-bxor) operator 112
binary not (-bnot) operator 112, 113
binary operators 110
binary and (-band) operator 111
binary exclusive or (-bxor) operator 112
binary not (-bnot) operator 112
binary or (-bor) operator 111
shift left (-shl) operator 113, 114, 115
shift right (-shr) operator 113, 114, 115
binary or (-bor) operator 111
bit field 283
breakpoints 726
built-in help system, PowerShell 5
About_* help files 14
Get-Help command 7
updatable help, supporting modules 6
Update-Help command 13
Byte-Order Mark (BOM) 119
URL 119
C
call operator (&) 122
Cascading Style Sheet (CSS) 335
reference link 335
casting
casting, to Void
example 515
CertificatePolicy property 373
certificate provider 32
certificates
chain of trust 372
character class 250
character class subtraction 253
negated character class 252
shorthand character classes 253
Unicode category class 253, 254
character class subtraction 253
chocolatey
URL 55
Chocolatey Server
reference link 617
Chocolatey.Server package 55
CIM objects
CIM sessions 422
Get-CimSession 423
New-CimSession 422
using 423
class 193
creating 575
Hidden modifier 580
properties 576
classes 627
classes, for implementing parameter 592
argument-transformation attribute classes 592, 593, 594
validation attribute classes 594
cleanup block 506, 509, 510, 511
closures 495
CmdletBinding attribute 498, 499
common parameters 499
properties 500
ShouldContinue method 501, 503, 504, 505
ShouldProcess method 500, 501, 502, 503
cmdlet development guidelines, PowerShell
reference link 492
command breakpoint
commands
discovering 16
commands, mocking 661, 662, 663
parameters, filtering 664, 665
comma operator 123
comma-separated value (CSV) 226
Comma-Separated Value (CSV) files 88
Common Information Model (CIM) 422
Common Information Model (CIM) cmdlets 305
associated classes 312
classes, obtaining 306
methods, calling 307, 308, 309
properties 304
working, with sessions 310, 311
community-created PowerShell Practice and Style repository
reference link 492
Compare-Object command 84, 85, 86
comparing 84
comparison operators
and arrays 101
case sensitivity 101
-contains 104
equal to (-eq) 102
greater than (-gt) 103
-in 104
less than (-lt) 103
-like operator 103
not equal to (-ne) 102
-notlike operator 103
null value 101
using 100
conditional parameters 564, 565
conditional testing
about 657
Set-ItResult command, using 658
-Skip command, using 659
ConfirmPreference 25, 26, 27, 28
Contains method 222
Context keyword
tests, describing with 652
continue keyword 177, 178, 183
ConvertFrom-Csv command 89
ConvertFrom-Json command 363, 364
NoEnumerate 366
ConvertFrom-String command 229
ConvertFrom-StringData command 227
converting 86
Convert-String command 228
ConvertTo-Html command 333, 334, 336
ConvertTo-Json command 360, 361
AsArray 362
EnumsAsStrings 362
EscapeHandling 362
ConvertTo-XML command 342
C Sharp (C#) programming guide
reference link 197
custom script analyzer rules
custom rule, creating 645
D
Data Protection API (DPAPI) 91
dates
comparing 239
dates and times
manipulating 234
Debuggex
URL 246
debugging 713
in console 726
in Visual Studio Code 730
debugging, in Visual Studio Code 730
launch configurations, launching 734, 736, 737
decrement operator (--) 124
default values 497
Describe keyword
tests, describing with 652
Desired State Configuration (DSC) 334, 599, 600
development strategies 713
discretionary access control list (DACL) 325
Discretionary Access Control List (DACL) 286
Dispatcher
Distributed Component Object Model (DCOM) 304
Distributed Management Task Force (DMTF) 304
division operator 96
DockPanel control
Document Type Definition (DTD) 337, 339
Domain-Specific Language 648
Domain-Specific Language (DSL) 334
double-hop problem 420
credentials, passing 421
CredSSP 421
do until loop 181
do while loop 181
drive letters
functions 34
Dynamic Link Library (DLL) 46
dynamicparam block 506
dynamic parameters
RuntimeDefinedParameterDictionary, using 561
RuntimeDefinedParameter object, creating 559, 560, 561
E
elseif statement 172
else statement 172
EndsWith method 222
Enter-PSSession command 413
entries
copying 291
enumerating 66
automatic value assignment 569, 570
Flags attribute 571, 572, 573, 574
using, to convert value 574, 575
ValidateSet 570
enumerations 627
Get-Error command 688
errors
catching 694
inconsistent handling 701, 703
raising 689
error types 683
non-terminating error 684
EventArgs parameter 437, 438, 439
buttons and click event 474, 475
ComboBox and SelectionChanged 476
elements programmatically, adding 476, 477, 478
ListView, sorting 478, 480, 482
events
reacting to 434
existing items
testing 280
Export-Clixml command 90
exporting 86
Export-PSSession 414
Extended Type System (ETS) 60
Extensible Application Markup Language (XAML) 454, 455
Extensible Markup Language (XML) 337
attributes 338
ConvertTo-XML command 342
elements 338
namespaces 338
schemas 339
F
file attributes
file catalog commands 297
New-FileCatalog command 298
Test-FileCatalog command 298, 299, 300, 301
File Integrity Monitoring (FIM) 297
file parameter 174
filesystem 283
filtering 66
Find-Module command 51
Begin parameter 67
End parameter 67
MemberName parameter 70
positional parameters 68
ForEach parameter
using 657
functions 493
G
Get
implementing 601
Get-Command 9
Get-Content command 377
Get-Error command 688
Get-EventSubscriber command 436
Get-Help
Detailed switch parameter 10
examples 9
Full switch parameter 11
parameters 10
Get-Item command 278
Get-ItemProperty 283
Get-Job command
Get-Member command 60
Get method
implementing 601
Get-Module command 44
Get-PSSession command
Get-Unique 75
Get-WSManInstance 399
Global Assembly Cache (GAC) 190
greedy quantifier 249
Grid control
Group-Object command 79, 80, 81, 82
groups
purpose 255
repeating 256
H
hard link 281
hashing 297
Hashtables 156
creating 157
elements, adding 157, 158, 159
elements, changing 157, 158, 159
elements, removing from 160
elements, selecting 159
enumerating 160
HelpMessage property 529
HTML 333
ConvertTo-Html command 334
multiple tables 334
style, adding 335
HTTP over Secure Sockets Layer (SSL) 371
Hypertext Transfer Protocol (HTTP) 370
methods 370
I
IComparable interface
implementing 586, 587, 588, 589
if statement 172
assignment 172
Import-Csv command 88
Import-Module command 45
importng 86
Import-PSSession 413
Import-Xaml function 483
increment operator (++) 124
inheritance
and constructors 582, 583, 584
methods, calling in parent class 585
inheritance flags 289
InitialSessionState object 446, 447
functions, adding 449
snap-ins, adding 447
using 449
InModuleScope command 677, 678
input pipeline 542
input validation
about 530
PSReference parameters 541, 542
PSTypeName attribute, using 530, 531, 532
Insert method 219
Install-Module command 51
interfaces
working with 585
Internet Information Services (IIS) 55
Invoke-Command
AsJob parameter 411
Disconnected sessions 411, 412
local functions and remote sessions 410
splatting, using with ArgumentList 410, 411
using 409
using variable scope 412
Invoke-RestMethod command 375
IsReadOnly property 283
item properties 283
Get-ItemProperty 283
IsReadOnly property 283
Set-ItemProperty 283
items 280
invoking 282
iteration, with Pester
ForEach parameter, using 657
styles 655
TestCases parameter, using 655, 656
It keyword
using 652
J
JavaScript Object Notation (JSON) 360, 367
ConvertFrom-Json command 363, 364
ConvertTo-Json command 360, 361
JEA documentation
reference link 424
jobs 431
JSON serialization 361
junction link 281
Just Enough Administration (JEA) 424
role capabilities 426
session configuration file 424, 425
L
Language Integrated Query (LINQ) 354
Last-In, First-Out (LIFO) 168
layout 457
DockPanel control, using 463, 465, 466
Grid control, using 458, 459, 460, 461
StackPanel control, using 461, 463
lazy quantifier 249
line break
adding, after operator 516
adding, after pipe 516
line breakpoint
LINQ to XML
lists
copying 291
literal characters 242
Local Configuration Manager (LCM) 605
locating elements 468, 469, 470, 471, 472
logical operators
about 109
-and operator 109
-not (or !) operator 110
-or operator 109
-xor operator 109
long lines
working with 516
look-ahead 261
look-behind 261
loop 178
break keyword 182
continue keyword 183
while loop 182
loops
do until loop 181
do while loop 181
M
MD5 hashing 297
Measure-Object command 79, 82, 83, 84
measuring 79
Media Access Control (MAC) addresses 267, 268
member types, MSDN
reference link 60
MessageData parameter 437, 438, 439
methods, HTTP 1.1 specification
reference link 370
mocking
using 661
Mock keyword 661
mocks
module
creating 610
Export-ModuleMember command, using 611, 612, 613, 614
publishing, with Publish-Module command 617, 618
module content
module manifests
Test-ModuleManifest 616
Update-ModuleManifest command 616, 617
modules 44
finding 49
Import-Module command 45
installing 49
Remove-Module command 46
module scope
about 624
multi-file module layout 619
multiple instances
running 444
multiplication operator 96
multiply and assign operator 99
N
named block 511
named blocks
code, placing outside 719, 720
pipeline, without process 721
using 719
namespace 193
naming elements 468, 469, 470, 471, 472
negated character class 252
New-FileCatalog command 298
New-PSSession command
using 408
New-WebServiceProxy command 386
Nexus OSS
reference link 617
non-local commands
Non-local scoped variables 140
non-standard output 58
non-terminating errors 684, 685
raising, with WriteError method 692
nouns 15
NtfsSecurity module 286
NuGet repositories 55
null
output, assigning to 514
statement, assigning to 514
null coalescing assignment operator 127
null coalescing operator 125, 126
null conditional operator 127, 128
null input
numbers
manipulating 231
numeric values
in Access Control Lists (ACLs) 294, 295
O
OAuth 382
access token, requesting 384
application, creating 382
authorization code, obtaining 382
browser issues 383
HTTP listener, implementing 383, 384
token, using 384
object properties
accessing 61
objects
mocking 670
objects, mocking
methods, adding to PSCustomObject 670, 671
.NET types, disarming 671, 672, 673, 674
operator usage 716
assignment, instead of equality 716
negated array comparisons 718
-or, using 717
output
assigning, to null 514
Out-String command 336
P
paging
param block 496
Parameter attribute
HelpMessage property 529
ValueFromRemainingArguments property 528
parameter filters
Confirm 24
cross-referencing 498
mandatory parameters 19
mandatory positional parameters 19
optional positional parameters 19
switch parameters 20
WhatIf 24
parameter set 8
parameter sets
parameter types 496
parser modes 39
argument modes 39
parsing 370
PassThru parameter 30
permissions, in WMI
access control entry (ACE), adding 326, 327
security descriptor, obtaining 324, 325, 326
security descriptor, setting 327, 328
shared directory, creating 323
sharing 323
working with 323
Pester
AfterAll block 661
AfterEach block 661
assertions 652
BeforeAll block 661
BeforeEach block 661
Discovery phase 659
Run phase 659
testing methodologies 650
using, for iteration 655
pipeline 58
pipeline chain operators 128, 129
power 627
power of 10 232
PowerShell 3
ArgumentTypeConverterAttribute type 208, 209, 210, 211
built-in help system 5
command naming 15
PSModulePath 47
Reflection in 206
TypeAccelerators type 207, 208
PowerShell 7
Windows PowerShell modules, using in 48, 49
PowerShell classes 627
PowerShell development
issues 714
PowerShell development, issues
issue, with variables 721
named blocks usage 719
operator usage 716
reference link 50
PowerShellGet
installation link 50
repositories 53
version ranges 54
PowerShell instance
PowerShell remoting
enabling 398
over SSH 415
PowerShell remoting and permissions 402
PowerShell remoting, over SSH
connecting, from Linux to Windows 417, 419, 420
connecting, from Windows to Linux 416, 417
PowerShell Remoting Protocol (PSRP) package 397
PowerShell repositories 54
print working directory (PWD) 277
private functions 611
private variables 143
process block 507
ProGe
reference link 617
propagation flags 289
property set 76
creating 280
drives 279
Get-Item command 278
in operating systems 30
Windows-specific providers 31
PSDataCollection object 442, 443
PSKoans module
reference link 225
PSLocal repository
removing 618
PSMemberTypes Enum
reference link 197
PSModulePath
PSScriptAnalyzer module 492, 493
PSScriptAnalyzer repository instructions, for suppressing rules
reference link 493
PSSessions 408
Enter-PSSession command 413
Export-PSSession 413
Get-PSSession command, using 408, 409
Import-PSSession 413
Invoke-Command, using 409
items, copying between sessions 414
New-PSSession command, using 408
PSTypeName attribute
using 546
public functions 611
Publish-Module command
used, for publishing module 617
Q
quantifiers 244, 248, 249, 250
greedy quantifier 249
lazy quantifier 249
R
Receive-Job command
using, to retrieve data from job 429
redirection operators 117
streams, redirecting to standard output 120
used, for redirecting output to null 121
used, for redirecting to file 118, 120
redirection, to null
example 514
Reflection 206
in PowerShell 206
regex parameter 175
registry values
manipulating 285
regular expression-based operators 104
regular expression (regex)
any character (.) 243
characters 242
debugging 246
non-printable characters 246
operators 242
optional characters 246
quantifiers 244
reference link 247
regular expression (regex), examples 267
certificates, formatting 273, 274
remainder operator 97
Remove-Job command
Remove method 219
Remove-Module command 46
Replace method 217
Representational State Transfer (REST)
authentication 380
basic authentication, using 381
Invoke-RestMethod command 375
requests, with arguments 376, 377, 378
working with 375
Requires statement 494
reserved characters 124
resource
responsive interfaces 482, 483
Dispatcher, using 485, 486, 487, 488
Import-Xaml function 483
Runspace 483
role capabilities 426
root module 610
Runspace 483
RunspacePool object
RunspacePool objects
using 449
runspace pools
using 439
runspaces
using 439
Runspace-synchronized objects
S
Save-Module command 52
scope modifier
using 431
scope modifiers 140
scopes
script block 495
script blocks 493
scripts 493
nesting functions 494
Requires statement 494
ScriptsToProcess property 629, 630
security descriptor definition language (SDDL) 329, 330, 331
selecting 71
Select-Object command 71
ExpandProperty parameter 74
property sets 76
Select-Xml command 339
Send-MailMessage command 336
session configuration file 424, 425
Set-ItemProperty 283
Set-ItResult command
using 658
Set method
implementing 602
Set-WSManQuickConfig 400, 401, 402
SHA1 297
shift left (-shl) operator 113, 114, 115
shift right (-shr) operator 113, 114, 115
shorthand character classes 253
Should keyword
using 652
side-by-side versioning 618, 619
Simple Object Access Protocol (SOAP) 398
working with 385
SMB repository
creating 54
snap-ins 55
SOAP, in PowerShell 7 391
enumerations, discovering 391, 392
methods, executing 393, 394, 395
WSDL document, obtaining 391
SOAP, in Windows PowerShell 386
methods, and enumerations 387, 388, 389
methods, and SOAP objects 389
New-WebServiceProxy command 386
services, overlapping 390
SOAP service
finding 385
Software Development Kits (SDKs) 190
software testing
URL 650
sorting 71
Sort-Object command 71, 76, 77, 78, 79, 89
splatting 34
and positional parameters 38, 39
conditional use, of parameters 37
used, for avoiding long lines 35, 36, 37
used, for avoiding repetition 38
using 35
SSL errors
bypassing, in Windows PowerShell 372
StackPanel control
standard output (stdout) 58
Start-Job command
StartsWith method 222
statement
assigning, to null 514
custom script analyzer rules 644
PSScriptAnalyzer module, using 634, 635
tokenizer 644
streams 58
StringBuilder type, methods
reference link 201
strings
Contains method 222
ConvertFrom-String command 229
ConvertFrom-StringData command 227, 228
converting 226
converting, into numeric values 233
Convert-String command 228
EndsWith method 222
indexing into 214
Insert method 219
manipulating 213
Remove method 219
StartsWith method 222
ToLower method 221
ToTitleCase method 221
ToUpper method 221
TrimEnd method 218
Trim method 218
TrimStart method 218
Structured Query Language (SQL) 312
subtract and assign operator (-=) 99
switch statement 173
array parameter 174
file parameter 174
regex parameter 175
wildcard parameter 175
symbolic link 281
System Access Control List (SACL) 287
System.Collections.Generic.Dictionary 164
creating 164
elements, adding 165
elements, changing 165
elements, removing 167
elements, selecting 166
enumerating 166
System.Collections.Generic.List 161, 162
creating 162
elements, adding 162
elements, removing 164
elements, selecting 162, 163, 164
element values, changing 164
System.Collections.Generic.Queue 167
creating 167
elements, adding 167
elements, elements 168
enumerating 167
System.Collections.Generic.Stack 168
creating 168
elements, adding 169
elements, removing 169
System.Math
using 232
System.Xml.Linq namespace 354
attribute values, modifying 357, 358
documents, opening 354
nodes, adding 358
nodes, removing 359
nodes, selecting 355
schema validation 359
System.Xml namespace 342
T
target type 145
Tee-Object command 91
raising 693
raising, with ThrowTerminatingError method 693, 694
ternary operator 125
TestCases parameter
Test-Driven Development (TDD) 633
Test-FileCatalog command 298, 299, 300, 301
Test method
implementing 602
tests
describing 651
describing, with Context keyword 651
describing, with Describe keyword 651
ThreadJob module 432
ThrowTerminatingError method
ToLower method 221
ToTitleCase method 221
ToUpper method 221
trap
about 708
TrimEnd method 218
Trim method 218
TrimStart method 218
trusted hosts 407
type 191
TypeAccelerators type 207, 208
type conversion 143, 144, 145, 146
type operators 116
-as operator 116
-is operator 116
U
Unicode categories, documented on Microsoft Docs
reference link 254
Unicode category class 253, 254
Uniform Resource Identifier (URI) 341, 375
unit test 633
unit testing
performing, considerations 651
Unregister-Event commands 436
Update-Module command 52
UseBasicParsing parameter 370
User Account Control (UAC) 406
User Interfaces (UI)
designing 454
using keyword 194
using module 628
V
validation attribute classes 594
ValidateArgumentsAttribute 595, 596
ValidateEnumeratedArgumentsAttribute 596, 598
validation attributes
about 532
Allow attributes 540
AllowEmptyCollection attribute 540
AllowEmptyString attribute 540
AllowNull attribute 540
ValidateCount attribute 534
ValidateDrive attribute 534
ValidateLength attribute 535
ValidateNotNull attribute 533
ValidateNotNullOrEmpty attribute 533
ValidatePattern attribute 536, 537
ValidateRange attribute 537
ValidateScript attribute 538
ValidateSet attribute 539
ValidateUserDrive attribute 535
using, for multiple parameters 545, 546
ValueFromPipelineByPropertyName 547, 548, 549
ValueFromRemainingArguments property 528
values
variable breakpoints
variable commands 134
Clear-Variable command 135
Get-Variable command 135
New-Variable command 136
Remove-Variable command 136
Set-Variable command 137
variable issues 722
variables 724
statements, assigning to 100
type, assigning 724
verbs 15
reference link 15
Visual Studio Code (VS Code) 3
Extension installer 4
reference link 3
W
Wait-Job command 430
web requests 370
HTTPS 371
Web Services Description Language (WSDL) 391
while loop 182
wildcard parameter 175
Windows Management Instrumentation (WMI) 329, 330, 331
classes 304
commands 304
working with 303
Windows permissions 286
access 286
Access Control Entries (ACEs), removing 290, 291
audit 287
entries, copying 291
inheritance flags 289
lists, copying 291
propagation flags 289
Windows PowerShell
SSL errors, bypassing 372
Windows PowerShell modules
Windows Presentation Foundation (WPF) 454
Windows remoting
WMI cmdlets
properties 304
WMI permissions 328
security descriptor, obtaining 328
WMI Query Language (WQL) 312
associated classes 316
ASSOCIATORS OF, using 317, 318
comparison operators 314
FROM parameter 313
logic operators 314
object paths 317
SELECT parameter 313
sequences and wildcards character, escaping 313, 314
WHERE parameter 313
WMI type accelerators 319
associated classes 322
classes, obtaining 320
instances, creating 322
instances, obtaining 319
methods, calling 320, 321, 322
WriteError method
using 692
Write-Host 118
WS-Management 398
Get-WSManInstance 399
PowerShell remoting and permissions 402
PowerShell remoting, enabling 398
trusted hosts 407
User Account Control (UAC) 406
Windows remoting and SSL 399, 400
WSMan drive 399
WSMan drive 399
X
XML commands 337
XmlDocument 344
XML documents
attribute values, modifying 347
elements, adding 348
elements, modifying 347
namespaces 345
3.147.104.248