Foreword |
|
xvii | |
Preface |
|
xxi | |
Part I Tour |
|
|
A Guided Tour of PowerShell |
|
|
xxxi | |
Part II Fundamentals |
|
|
1 The PowerShell Interactive Shell |
|
|
1 | (76) |
|
|
1 | (1) |
|
1.1 Install PowerShell Core |
|
|
1 | (4) |
|
1.2 Run Programs, Scripts, and Existing Tools |
|
|
5 | (3) |
|
1.3 Run a PowerShell Command |
|
|
8 | (1) |
|
1.4 Resolve Errors Calling Native Executables |
|
|
9 | (2) |
|
1.5 Supply Default Values for Parameters |
|
|
11 | (2) |
|
1.6 Invoke a Long-Running or Background Command |
|
|
13 | (4) |
|
1.7 Program: Monitor a Command for Changes |
|
|
17 | (3) |
|
1.8 Notify Yourself of Job Completion |
|
|
20 | (1) |
|
1.9 Customize Your Shell, Profile, and Prompt |
|
|
21 | (3) |
|
1.10 Customize PowerShell's User Input Behavior |
|
|
24 | (3) |
|
1.11 Customize PowerShell's Command Resolution Behavior |
|
|
27 | (3) |
|
1.12 Find a Command to Accomplish a Task |
|
|
30 | (2) |
|
1.13 Get Help on a Command |
|
|
32 | (2) |
|
1.14 Update System Help Content |
|
|
34 | (2) |
|
1.15 Program: Search Help for Text |
|
|
36 | (1) |
|
1.16 Launch PowerShell at a Specific Location |
|
|
37 | (2) |
|
1.17 Invoke a PowerShell Command or Script from Outside PowerShell |
|
|
39 | (3) |
|
1.18 Understand and Customize PowerShell's Tab Completion |
|
|
42 | (4) |
|
1.19 Program: Learn Aliases for Common Commands |
|
|
46 | (2) |
|
1.20 Program: Learn Aliases for Common Parameters |
|
|
48 | (2) |
|
1.21 Access and Manage Your Console History |
|
|
50 | (2) |
|
1.22 Program: Create Scripts from Your Session History |
|
|
52 | (2) |
|
1.23 Invoke a Command from Your Session History |
|
|
54 | (2) |
|
1.24 Program: Search Formatted Output for a Pattern |
|
|
56 | (1) |
|
1.25 Interactively View and Process Command Output |
|
|
57 | (2) |
|
1.26 Program: Interactively View and Explore Objects |
|
|
59 | (8) |
|
1.27 Record a Transcript of Your Shell Session |
|
|
67 | (1) |
|
1.28 Extend Your Shell with Additional Commands |
|
|
68 | (2) |
|
1.29 Find and Install Additional PowerShell Scripts and Modules |
|
|
70 | (2) |
|
1.30 Use Commands from Customized Shells |
|
|
72 | (1) |
|
1.31 Save State Between Sessions |
|
|
73 | (4) |
|
|
77 | (24) |
|
|
77 | (1) |
|
2.1 Chain Commands Based on Their Success or Error |
|
|
78 | (1) |
|
2.2 Filter Items in a List or Command Output |
|
|
79 | (2) |
|
2.3 Group and Pivot Data by Name |
|
|
81 | (3) |
|
2.4 Interactively Filter Lists of Objects |
|
|
84 | (1) |
|
2.5 Work with Each Item in a List or Command Output |
|
|
84 | (4) |
|
2.6 Automate Data-Intensive Tasks |
|
|
88 | (4) |
|
2.7 Intercept Stages of the Pipeline |
|
|
92 | (1) |
|
2.8 Automatically Capture Pipeline Output |
|
|
93 | (2) |
|
2.9 Capture and Redirect Binary Process Output |
|
|
95 | (6) |
|
|
101 | (44) |
|
|
101 | (1) |
|
3.1 Display the Properties of an Item as a List |
|
|
102 | (2) |
|
3.2 Display the Properties of an Item as a Table |
|
|
104 | (2) |
|
3.3 Store Information in Variables |
|
|
106 | (1) |
|
3.4 Access Environment Variables |
|
|
107 | (3) |
|
3.5 Program: Retain Changes to Environment Variables Set by a Batch File |
|
|
110 | (2) |
|
3.6 Control Access and Scope of Variables and Other Items |
|
|
112 | (2) |
|
3.7 Program: Create a Dynamic Variable |
|
|
114 | (3) |
|
3.8 Work with .NET Objects |
|
|
117 | (4) |
|
3.9 Create an Instance of a .NET Object |
|
|
121 | (3) |
|
3.10 Create Instances of Generic Objects |
|
|
124 | (1) |
|
|
125 | (1) |
|
3.12 Learn About Types and Objects |
|
|
126 | (2) |
|
3.13 Get Detailed Documentation About Types and Objects |
|
|
128 | (2) |
|
3.14 Add Custom Methods and Properties to Objects |
|
|
130 | (2) |
|
3.15 Create and Initialize Custom Objects |
|
|
132 | (4) |
|
3.16 Add Custom Methods and Properties to Types |
|
|
136 | (5) |
|
3.17 Define Custom Formatting for a Type |
|
|
141 | (4) |
|
4 Looping and Flow Control |
|
|
145 | (14) |
|
|
145 | (1) |
|
4.1 Make Decisions with Comparison and Logical Operators |
|
|
145 | (3) |
|
4.2 Adjust Script Flow Using Conditional Statements |
|
|
148 | (1) |
|
4.3 Manage Large Conditional Statements with Switches |
|
|
149 | (3) |
|
4.4 Repeat Operations with Loops |
|
|
152 | (2) |
|
4.5 Process Time-Consuming Action in Parallel |
|
|
154 | (3) |
|
|
157 | (2) |
|
5 Strings and Unstructured Text |
|
|
159 | (34) |
|
|
159 | (1) |
|
|
159 | (2) |
|
5.2 Create a Multiline or Formatted String |
|
|
161 | (1) |
|
5.3 Place Special Characters in a String |
|
|
162 | (1) |
|
5.4 Insert Dynamic Information in a String |
|
|
163 | (1) |
|
5.5 Prevent a String from Including Dynamic Information |
|
|
164 | (1) |
|
5.6 Place Formatted Information in a String |
|
|
165 | (2) |
|
5.7 Search a String for Text or a Pattern |
|
|
167 | (2) |
|
5.8 Replace Text in a String |
|
|
169 | (2) |
|
5.9 Split a String on Text or a Pattern |
|
|
171 | (2) |
|
5.10 Combine Strings into a Larger String |
|
|
173 | (2) |
|
5.11 Convert a String to Uppercase or Lowercase |
|
|
175 | (2) |
|
|
177 | (1) |
|
5.13 Format a Date for Output |
|
|
178 | (2) |
|
5.14 Convert a String Between One Format and Another |
|
|
180 | (1) |
|
5.15 Convert Text Streams to Objects |
|
|
181 | (5) |
|
5.16 Generate Large Reports and Text Streams |
|
|
186 | (2) |
|
5.17 Generate Source Code and Other Repetitive Text |
|
|
188 | (5) |
|
|
193 | (16) |
|
|
193 | (1) |
|
6.1 Perform Simple Arithmetic |
|
|
193 | (2) |
|
6.2 Perform Complex Arithmetic |
|
|
195 | (3) |
|
6.3 Measure Statistical Properties of a List |
|
|
198 | (2) |
|
6.4 Work with Numbers as Binary |
|
|
200 | (4) |
|
6.5 Simplify Math with Administrative Constants |
|
|
204 | (1) |
|
6.6 Convert Numbers Between Bases |
|
|
205 | (4) |
|
7 Lists, Arrays, and Hashtables |
|
|
209 | (20) |
|
|
209 | (1) |
|
7.1 Create an Array or List of Items |
|
|
209 | (2) |
|
7.2 Create a Jagged or Multidimensional Array |
|
|
211 | (1) |
|
7.3 Access Elements of an Array |
|
|
212 | (2) |
|
7.4 Visit Each Element of an Array |
|
|
214 | (1) |
|
7.5 Sort an Array or List of Items |
|
|
215 | (1) |
|
7.6 Determine Whether an Array Contains an Item |
|
|
216 | (1) |
|
|
217 | (1) |
|
7.8 Find Items in an Array That Match a Value |
|
|
218 | (1) |
|
|
219 | (1) |
|
7.10 Remove Elements from an Array |
|
|
220 | (1) |
|
7.11 Find Items in an Array Greater or Less Than a Value |
|
|
221 | (1) |
|
7.12 Use the ArrayList Class for Advanced Array Tasks |
|
|
222 | (1) |
|
7.13 Create a Hashtable or Associative Array |
|
|
223 | (2) |
|
7.14 Sort a Hashtable by Key or Value |
|
|
225 | (4) |
|
|
229 | (16) |
|
|
229 | (1) |
|
8.1 Get the System Date and Time |
|
|
229 | (1) |
|
8.2 Measure the Duration of a Command |
|
|
230 | (2) |
|
8.3 Read and Write from the Clipboard |
|
|
232 | (1) |
|
8.4 Generate a Random Number or Object |
|
|
233 | (2) |
|
8.5 Convert Time Between Time Zones |
|
|
235 | (1) |
|
8.6 Program: Search the Windows Start Menu |
|
|
236 | (1) |
|
8.7 Program: Show Colorized Script Content |
|
|
237 | (8) |
Part III Common Tasks |
|
|
|
245 | (22) |
|
|
245 | (1) |
|
9.1 Get the Content of a File |
|
|
245 | (2) |
|
9.2 Store the Output of a Command into a File |
|
|
247 | (1) |
|
9.3 Add Information to the End of a File |
|
|
248 | (1) |
|
9.4 Search a File for Text or a Pattern |
|
|
249 | (3) |
|
9.5 Parse and Manage Text-Based Logfiles |
|
|
252 | (3) |
|
9.6 Parse and Manage Binary Files |
|
|
255 | (2) |
|
9.7 Create and Manage Temporary Files |
|
|
257 | (2) |
|
9.8 Search and Replace Text in a File |
|
|
259 | (3) |
|
9.9 Program: Get the Encoding of a File |
|
|
262 | (3) |
|
9.10 View the Hexadecimal Representation of Content |
|
|
265 | (2) |
|
|
267 | (20) |
|
|
267 | (1) |
|
10.1 Access Information in an XML File |
|
|
268 | (2) |
|
10.2 Perform an XPath Query Against XML |
|
|
270 | (2) |
|
10.3 Convert Objects to XML |
|
|
272 | (1) |
|
10.4 Modify Data in an XML File |
|
|
273 | (2) |
|
10.5 Easily Import and Export Your Structured Data |
|
|
275 | (2) |
|
10.6 Store the Output of a Command in a CSV or Delimited File |
|
|
277 | (1) |
|
10.7 Import CSV and Delimited Data from a File |
|
|
278 | (2) |
|
10.8 Manage JSON Data Streams |
|
|
280 | (1) |
|
10.9 Use Excel to Manage Command Output |
|
|
281 | (2) |
|
10.10 Parse and Interpret PowerShell Scripts |
|
|
283 | (4) |
|
|
287 | (60) |
|
|
287 | (1) |
|
|
287 | (3) |
|
|
290 | (2) |
|
11.3 Find a Verb Appropriate for a Command Name |
|
|
292 | (1) |
|
11.4 Write a Script Block |
|
|
293 | (2) |
|
11.5 Return Data from a Script, Function, or Script Block |
|
|
295 | (2) |
|
11.6 Package Common Commands in a Module |
|
|
297 | (4) |
|
11.7 Write Commands That Maintain State |
|
|
301 | (2) |
|
11.8 Selectively Export Commands from a Module |
|
|
303 | (2) |
|
11.9 Diagnose and Interact with Internal Module State |
|
|
305 | (2) |
|
11.10 Handle Cleanup Tasks When a Module Is Removed |
|
|
307 | (1) |
|
11.11 Access Arguments of a Script, Function, or Script Block |
|
|
308 | (6) |
|
11.12 Add Validation to Parameters |
|
|
314 | (4) |
|
11.13 Accept Script Block Parameters with Local Variables |
|
|
318 | (2) |
|
11.14 Dynamically Compose Command Parameters |
|
|
320 | (2) |
|
11.15 Provide -Whatlf, -Confirm, and Other Cmdlet Features |
|
|
322 | (3) |
|
11.16 Add Help to Scripts or Functions |
|
|
325 | (2) |
|
11.17 Add Custom Tags to a Function or Script Block |
|
|
327 | (2) |
|
11.18 Access a Script's Pipeline Input |
|
|
329 | (2) |
|
11.19 Write Pipeline-Oriented Scripts with Cmdlet Keywords |
|
|
331 | (4) |
|
11.20 Write a Pipeline-Oriented Function |
|
|
335 | (1) |
|
11.21 Organize Scripts for Improved Readability |
|
|
336 | (2) |
|
11.22 Invoke Dynamically Named Commands |
|
|
338 | (2) |
|
11.23 Program: Enhance or Extend an Existing Cmdlet |
|
|
340 | (7) |
|
12 Internet-Enabled Scripts |
|
|
347 | (32) |
|
|
347 | (1) |
|
12.1 Download a File from an FTP or Internet Site |
|
|
347 | (1) |
|
12.2 Upload a File to an FTP Site |
|
|
348 | (2) |
|
12.3 Program: Resolve the Destination of an Internet Redirect |
|
|
350 | (1) |
|
12.4 Download a Web Page from the Internet |
|
|
351 | (6) |
|
12.5 Parse and Analyze a Web Page from the Internet |
|
|
357 | (2) |
|
12.6 Script a Web Application Session |
|
|
359 | (4) |
|
12.7 Interact with REST-Based Web APIs |
|
|
363 | (3) |
|
12.8 Connect to a Web Service |
|
|
366 | (1) |
|
12.9 Interact with and Manage Remote SSL Certificates |
|
|
367 | (2) |
|
12.10 Export Command Output as a Web Page |
|
|
369 | (1) |
|
|
369 | (1) |
|
12.12 Program: Monitor Website Uptimes |
|
|
370 | (2) |
|
12.13 Program: Interact with Internet Protocols |
|
|
372 | (7) |
|
|
379 | (26) |
|
|
379 | (1) |
|
13.1 Read a Line of User Input |
|
|
379 | (1) |
|
13.2 Read a Key of User Input |
|
|
380 | (1) |
|
13.3 Program: Display a Menu to the User |
|
|
381 | (2) |
|
13.4 Display Messages and Output to the User |
|
|
383 | (3) |
|
13.5 Provide Progress Updates on Long-Running Tasks |
|
|
386 | (2) |
|
13.6 Write Culture-Aware Scripts |
|
|
388 | (3) |
|
13.7 Support Other Languages in Script Output |
|
|
391 | (3) |
|
13.8 Program: Invoke a Script Block with Alternate Culture Settings |
|
|
394 | (1) |
|
13.9 Access Features of the Host's UI |
|
|
395 | (2) |
|
13.10 Add a Graphical User Interface to Your Script |
|
|
397 | (3) |
|
13.11 Program: Add a Console UI to Your Script |
|
|
400 | (2) |
|
13.12 Interact with MTA Objects |
|
|
402 | (3) |
|
|
405 | (28) |
|
|
405 | (2) |
|
14.1 Prevent Common Scripting Errors |
|
|
407 | (2) |
|
14.2 Write Unit Tests for your Scripts |
|
|
409 | (2) |
|
14.3 Trace Script Execution |
|
|
411 | (3) |
|
14.4 Set a Script Breakpoint |
|
|
414 | (3) |
|
14.5 Debug a Script When It Encounters an Error |
|
|
417 | (2) |
|
14.6 Create a Conditional Breakpoint |
|
|
419 | (2) |
|
14.7 Investigate System State While Debugging |
|
|
421 | (3) |
|
14.8 Debug a Script on a Remote Machine |
|
|
424 | (2) |
|
14.9 Program: Watch an Expression for Changes |
|
|
426 | (2) |
|
14.10 Debug a Script in Another Process |
|
|
428 | (2) |
|
14.11 Program: Get Script Code Coverage |
|
|
430 | (3) |
|
15 Tracing and Error Management |
|
|
433 | (16) |
|
|
433 | (1) |
|
15.1 Determine the Status of the Last Command |
|
|
434 | (1) |
|
15.2 View the Errors Generated by a Command |
|
|
435 | (2) |
|
15.3 Manage the Error Output of Commands |
|
|
437 | (2) |
|
15.4 Program: Resolve an Error |
|
|
439 | (1) |
|
15.5 Configure Debug, Verbose, and Progress Output |
|
|
440 | (2) |
|
15.6 Handle Warnings, Errors, and Terminating Errors |
|
|
442 | (3) |
|
15.7 Output Warnings, Errors, and Terminating Errors |
|
|
445 | (1) |
|
15.8 Analyze a Script's Performance Profile |
|
|
446 | (3) |
|
16 Environmental Awareness |
|
|
449 | (18) |
|
|
449 | (1) |
|
16.1 View and Modify Environment Variables |
|
|
449 | (2) |
|
16.2 Modify the User or System Path |
|
|
451 | (1) |
|
16.3 Access Information About Your Command's Invocation |
|
|
452 | (2) |
|
16.4 Program: Investigate the Invocationlnfo Variable |
|
|
454 | (3) |
|
16.5 Find Your Script's Name |
|
|
457 | (1) |
|
16.6 Find Your Script's Location |
|
|
457 | (1) |
|
16.7 Find the Location of Common System Paths |
|
|
458 | (3) |
|
16.8 Get the Current Location |
|
|
461 | (1) |
|
16.9 Safely Build File Paths Out of Their Components |
|
|
462 | (1) |
|
16.10 Interact with PowerShell's Global Environment |
|
|
463 | (1) |
|
16.11 Determine PowerShell Version Information |
|
|
464 | (1) |
|
16.12 Test for Administrative Privileges |
|
|
465 | (2) |
|
17 Extend the Reach of PowerShell |
|
|
467 | (32) |
|
|
467 | (1) |
|
17.1 Automate Programs Using COM Scripting Interfaces |
|
|
467 | (2) |
|
17.2 Program: Query a SQL Data Source |
|
|
469 | (3) |
|
17.3 Access Windows Performance Counters |
|
|
472 | (2) |
|
17.4 Access Windows API Functions |
|
|
474 | (7) |
|
17.5 Program: Invoke Simple Windows API Calls |
|
|
481 | (3) |
|
17.6 Define or Extend a .NET Class |
|
|
484 | (3) |
|
17.7 Add Inline C# to Your PowerShell Script |
|
|
487 | (2) |
|
17.8 Access a .NET SDK Library |
|
|
489 | (2) |
|
17.9 Create Your Own PowerShell Cmdlet |
|
|
491 | (3) |
|
17.10 Add PowerShell Scripting to Your Own Program |
|
|
494 | (5) |
|
18 Security and Script Signing |
|
|
499 | (48) |
|
|
499 | (2) |
|
18.1 Enable Scripting Through an Execution Policy |
|
|
501 | (3) |
|
18.2 Enable PowerShell Security Logging |
|
|
504 | (5) |
|
18.3 Disable Warnings for UNC Paths |
|
|
509 | (1) |
|
18.4 Sign a PowerShell Script, Module, or Formatting File |
|
|
510 | (2) |
|
18.5 Create a Self-Signed Certificate |
|
|
512 | (1) |
|
18.6 Manage PowerShell Security in an Enterprise |
|
|
513 | (2) |
|
18.7 Block Scripts by Publisher, Path, or Hash |
|
|
515 | (3) |
|
18.8 Verify the Digital Signature of a PowerShell Script |
|
|
518 | (1) |
|
18.9 Securely Handle Sensitive Information |
|
|
519 | (2) |
|
18.10 Securely Request Usernames and Passwords |
|
|
521 | (2) |
|
18.11 Start a Process as Another User |
|
|
523 | (1) |
|
18.12 Program: Run a Temporarily Elevated Command |
|
|
524 | (2) |
|
18.13 Securely Store Credentials on Disk |
|
|
526 | (2) |
|
18.14 Access User and Machine Certificates |
|
|
528 | (1) |
|
18.15 Program: Search the Certificate Store |
|
|
529 | (2) |
|
18.16 Add and Remove Certificates |
|
|
531 | (1) |
|
18.17 Manage Security Descriptors in SDDL Form |
|
|
532 | (2) |
|
18.18 Create a Task-Specific Remoting Endpoint |
|
|
534 | (3) |
|
18.19 Limit Interactive Use of PowerShell |
|
|
537 | (2) |
|
18.20 Detect and Prevent Code Injection Vulnerabilities |
|
|
539 | (4) |
|
18.21 Get the Cryptographic Hash of a File |
|
|
543 | (1) |
|
18.22 Capture and Validate Integrity of File Sets |
|
|
544 | (3) |
|
|
547 | (10) |
|
|
547 | (2) |
|
|
549 | (2) |
|
19.2 Connect to a Remote Computer |
|
|
551 | (1) |
|
19.3 Interact with Visual Studio Code Through Its Object Model |
|
|
552 | (1) |
|
19.4 Quickly Insert Script Snippets |
|
|
553 | (4) |
Part IV Administrator Tasks |
|
|
|
557 | (36) |
|
|
557 | (1) |
|
20.1 Determine and Change the Current Location |
|
|
558 | (2) |
|
20.2 Get the Files in a Directory |
|
|
560 | (2) |
|
20.3 Find All Files Modified Before a Certain Date |
|
|
562 | (1) |
|
20.4 Clear the Content of a File |
|
|
563 | (1) |
|
20.5 Manage and Change the Attributes of a File |
|
|
564 | (1) |
|
20.6 Find Files That Match a Pattern |
|
|
565 | (3) |
|
20.7 Manage Files That Include Special Characters |
|
|
568 | (1) |
|
20.8 Program: Get Disk Usage Information |
|
|
569 | (2) |
|
20.9 Monitor a File for Changes |
|
|
571 | (1) |
|
20.10 Get the Version of a DLL or Executable |
|
|
572 | (1) |
|
|
573 | (1) |
|
20.12 Remove a File or Directory |
|
|
573 | (1) |
|
20.13 Rename a File or Directory |
|
|
574 | (2) |
|
20.14 Move a File or Directory |
|
|
576 | (1) |
|
20.15 Create and Map PowerShell Drives |
|
|
576 | (2) |
|
20.16 Access Long File and Directory Names |
|
|
578 | (1) |
|
|
579 | (2) |
|
20.18 Interact with Alternate Data Streams |
|
|
581 | (1) |
|
20.19 Program: Move or Remove a Locked File |
|
|
582 | (2) |
|
20.20 Get the ACL of a File or Directory |
|
|
584 | (2) |
|
20.21 Set the ACL of a File or Directory |
|
|
586 | (1) |
|
20.22 Program: Add Extended File Properties to Files |
|
|
587 | (3) |
|
20.23 Manage ZIP Archives |
|
|
590 | (3) |
|
|
593 | (26) |
|
|
593 | (1) |
|
21.1 Navigate the Registry |
|
|
593 | (1) |
|
|
594 | (1) |
|
21.3 Modify or Remove a Registry Key Value |
|
|
595 | (1) |
|
21.4 Create a Registry Key Value |
|
|
596 | (1) |
|
21.5 Remove a Registry Key |
|
|
597 | (1) |
|
21.6 Safely Combine Related Registry Modifications |
|
|
598 | (2) |
|
21.7 Add a Site to an Internet Explorer Security Zone |
|
|
600 | (2) |
|
21.8 Modify Internet Explorer Settings |
|
|
602 | (1) |
|
21.9 Program: Search the Windows Registry |
|
|
603 | (2) |
|
21.10 Get the ACL of a Registry Key |
|
|
605 | (1) |
|
21.11 Set the ACL of a Registry Key |
|
|
606 | (2) |
|
21.12 Work with the Registry of a Remote Computer |
|
|
608 | (2) |
|
21.13 Program: Get Registry Items from Remote Machines |
|
|
610 | (2) |
|
21.14 Program: Get Properties of Remote Registry Keys |
|
|
612 | (1) |
|
21.15 Program: Set Properties of Remote Registry Keys |
|
|
613 | (2) |
|
21.16 Discover Registry Settings for Programs |
|
|
615 | (4) |
|
|
619 | (4) |
|
|
619 | (1) |
|
22.1 Compare the Output of Two Commands |
|
|
619 | (2) |
|
22.2 Determine the Differences Between Two Files |
|
|
621 | (2) |
|
|
623 | (18) |
|
|
623 | (1) |
|
|
623 | (1) |
|
23.2 Get the Oldest Entries from an Event Log |
|
|
624 | (1) |
|
23.3 Find Event Log Entries with Specific Text |
|
|
625 | (2) |
|
23.4 Retrieve and Filter Event Log Entries |
|
|
627 | (3) |
|
23.5 Find Event Log Entries by Their Frequency |
|
|
630 | (2) |
|
23.6 Back Up an Event Log |
|
|
632 | (1) |
|
23.7 Create or Remove an Event Log |
|
|
633 | (2) |
|
23.8 Write to an Event Log |
|
|
635 | (1) |
|
23.9 Run a PowerShell Script for Windows Event Log Entries |
|
|
636 | (1) |
|
23.10 Clear or Maintain an Event Log |
|
|
637 | (2) |
|
23.11 Access Event Logs of a Remote Machine |
|
|
639 | (2) |
|
|
641 | (10) |
|
|
641 | (1) |
|
24.1 List Currently Running Processes |
|
|
642 | (1) |
|
24.2 Launch the Application Associated with a Document |
|
|
643 | (1) |
|
|
644 | (2) |
|
|
646 | (1) |
|
24.5 Get the Owner of a Process |
|
|
647 | (1) |
|
24.6 Get the Parent Process of a Process |
|
|
648 | (1) |
|
|
649 | (2) |
|
|
651 | (4) |
|
|
651 | (1) |
|
25.1 List All Running Services |
|
|
651 | (2) |
|
25.2 Manage a Running Service |
|
|
653 | (1) |
|
|
654 | (1) |
|
|
655 | (26) |
|
|
655 | (1) |
|
26.1 Test Active Directory Scripts on a Local Installation |
|
|
656 | (2) |
|
26.2 Create an Organizational Unit |
|
|
658 | (1) |
|
26.3 Get the Properties of an Organizational Unit |
|
|
659 | (1) |
|
26.4 Modify Properties of an Organizational Unit |
|
|
660 | (1) |
|
26.5 Delete an Organizational Unit |
|
|
661 | (1) |
|
26.6 Get the Children of an Active Directory Container |
|
|
662 | (1) |
|
26.7 Create a User Account |
|
|
662 | (1) |
|
26.8 Program: Import Users in Bulk to Active Directory |
|
|
663 | (3) |
|
26.9 Search for a User Account |
|
|
666 | (1) |
|
26.10 Get and List the Properties of a User Account |
|
|
667 | (1) |
|
26.11 Modify Properties of a User Account |
|
|
668 | (1) |
|
26.12 Change a User Password |
|
|
668 | (1) |
|
26.13 Create a Security or Distribution Group |
|
|
669 | (2) |
|
26.14 Search for a Security or Distribution Group |
|
|
671 | (1) |
|
26.15 Get the Properties of a Group |
|
|
672 | (1) |
|
26.16 Find the Owner of a Group |
|
|
672 | (1) |
|
26.17 Modify Properties of a Security or Distribution Group |
|
|
673 | (1) |
|
26.18 Add a User to a Security or Distribution Group |
|
|
674 | (1) |
|
26.19 Remove a User from a Security or Distribution Group |
|
|
675 | (1) |
|
26.20 List a User's Group Membership |
|
|
675 | (1) |
|
26.21 List the Members of a Group |
|
|
676 | (1) |
|
26.22 List the Users in an Organizational Unit |
|
|
677 | (1) |
|
26.23 Search for a Computer Account |
|
|
678 | (1) |
|
26.24 Get and List the Properties of a Computer Account |
|
|
679 | (2) |
|
27 Enterprise Computer Management |
|
|
681 | (30) |
|
|
681 | (1) |
|
27.1 Join a Computer to a Domain or Workgroup |
|
|
681 | (1) |
|
27.2 Remove a Computer from a Domain |
|
|
682 | (1) |
|
|
683 | (1) |
|
27.4 Program: List Logon or Logoff Scripts for a User |
|
|
684 | (1) |
|
27.5 Program: List Startup or Shutdown Scripts for a Machine |
|
|
685 | (2) |
|
27.6 Deploy PowerShell-Based Logon Scripts |
|
|
687 | (1) |
|
27.7 Enable or Disable the Windows Firewall |
|
|
688 | (1) |
|
27.8 Open or Close Ports in the Windows Firewall |
|
|
688 | (1) |
|
27.9 Program: List All Installed Software |
|
|
689 | (2) |
|
27.10 Uninstall an Application |
|
|
691 | (1) |
|
27.11 Manage Computer Restore Points |
|
|
692 | (2) |
|
27.12 Reboot or Shut Down a Computer |
|
|
694 | (1) |
|
27.13 Determine Whether a Hotfix Is Installed |
|
|
695 | (1) |
|
27.14 Manage Scheduled Tasks on a Computer |
|
|
696 | (3) |
|
27.15 Retrieve Printer Information |
|
|
699 | (1) |
|
27.16 Retrieve Printer Queue Statistics |
|
|
700 | (2) |
|
27.17 Manage Printers and Print Queues |
|
|
702 | (1) |
|
27.18 Program: Summarize System Information |
|
|
703 | (2) |
|
|
705 | (1) |
|
27.20 Assign a Static IP Address |
|
|
706 | (2) |
|
27.21 List All IP Addresses for a Computer |
|
|
708 | (1) |
|
27.22 List Network Adapter Properties |
|
|
709 | (2) |
|
28 CIM and Windows Management Instrumentation |
|
|
711 | (20) |
|
|
711 | (2) |
|
28.1 Access Windows Management Instrumentation and CIM Data |
|
|
713 | (3) |
|
28.2 Modify the Properties of a WMI or CIM Instance |
|
|
716 | (2) |
|
28.3 Invoke a Method on a WMI Instance or Class |
|
|
718 | (1) |
|
28.4 Program: Determine Properties Available to WMI and CIM Filters |
|
|
719 | (1) |
|
28.5 Search for the WMI or CIM Class to Accomplish a Task |
|
|
720 | (5) |
|
28.6 Use .NET to Perform Advanced WMI Tasks |
|
|
725 | (1) |
|
28.7 Convert a VBScript WMI Script to PowerShell |
|
|
726 | (5) |
|
|
731 | (42) |
|
|
731 | (1) |
|
29.1 Find Commands That Support Their Own Remoting |
|
|
732 | (1) |
|
29.2 Enable PowerShell Remoting on a Computer |
|
|
733 | (2) |
|
29.3 Enable SSH as a PowerShell Remoting Transport |
|
|
735 | (2) |
|
29.4 Interactively Manage a Remote Computer |
|
|
737 | (3) |
|
29.5 Invoke a Command on a Remote Computer |
|
|
740 | (4) |
|
29.6 Disconnect and Reconnect PowerShell Sessions |
|
|
744 | (2) |
|
29.7 Program: Remotely Enable PowerShell Remoting |
|
|
746 | (1) |
|
29.8 Program: Invoke a PowerShell Expression on a Remote Machine |
|
|
747 | (3) |
|
29.9 Test Connectivity Between Two Computers |
|
|
750 | (3) |
|
29.10 Limit Networking Scripts to Hosts That Respond |
|
|
753 | (1) |
|
29.11 Enable Remote Desktop on a Computer |
|
|
754 | (1) |
|
29.12 Configure User Permissions for Remoting |
|
|
754 | (2) |
|
29.13 Enable Remoting to Workgroup Computers |
|
|
756 | (2) |
|
29.14 Implicitly Invoke Commands from a Remote Computer |
|
|
758 | (2) |
|
29.15 Create Sessions with Full Network Access |
|
|
760 | (3) |
|
29.16 Pass Variables to Remote Sessions |
|
|
763 | (2) |
|
29.17 Manage and Edit Files on Remote Machines |
|
|
765 | (2) |
|
29.18 Configure Advanced Remoting Quotas and Options |
|
|
767 | (2) |
|
29.19 Invoke a Command on Many Computers |
|
|
769 | (2) |
|
29.20 Run a Local Script on a Remote Computer |
|
|
771 | (1) |
|
29.21 Determine Whether a Script Is Running on a Remote Computer |
|
|
772 | (1) |
|
|
773 | (8) |
|
|
773 | (2) |
|
30.1 Safely Experiment with Transactions |
|
|
775 | (2) |
|
30.2 Change Error Recovery Behavior in Transactions |
|
|
777 | (4) |
|
|
781 | (16) |
|
|
781 | (1) |
|
31.1 Respond to Automatically Generated Events |
|
|
782 | (3) |
|
31.2 Create and Respond to Custom Events |
|
|
785 | (3) |
|
31.3 Create a Temporary Event Subscription |
|
|
788 | (1) |
|
31.4 Forward Events from a Remote Computer |
|
|
789 | (1) |
|
31.5 Investigate Internal Event Action State |
|
|
790 | (2) |
|
31.6 Use a Script Block as a .NET Delegate or Event Handler |
|
|
792 | |
Part V References |
|
|
A PowerShell Language and Environment |
|
|
797 | (64) |
|
B Regular Expression Reference |
|
|
861 | (10) |
|
|
871 | (4) |
|
|
875 | (4) |
|
E .NET DateTime Formatting |
|
|
879 | (6) |
|
F Selected .NET Classes and Their Uses |
|
|
885 | (8) |
|
|
893 | (8) |
|
H Selected COM Objects and Their Uses |
|
|
901 | (4) |
|
I Selected Events and Their Uses |
|
|
905 | (8) |
|
J Standard PowerShell Verbs |
|
|
913 | (6) |
Index |
|
919 | |