List of Listings

 

Chapter 6. PowerShell functions

Listing 6.1. The Get-Character function

Chapter 7. Advanced functions and scripts

Listing 7.1. Testing output type

Listing 7.2. Testing parameter sets

Chapter 8. Using and authoring modules

Listing 8.1. Counter.ps1 script

Listing 8.2. Counter module

Listing 8.3. Exporting variables

Listing 8.4. usesCount.psm1

Listing 8.5. usesCount2.psm1

Listing 8.6. A binary module

Listing 8.7. Wrapping a binary module in a script module—WrapBinaryModule.psm1

Chapter 9. Module manifests and metadata

Listing 9.1. testmanifest.psd1

Listing 9.2. Counter module

Listing 9.3. PSData entries from the Pester module

Chapter 10. Metaprogramming with scriptblocks and dynamic code

Listing 10.1. Scriptblock to perform string reversal

Listing 10.2. Adding a ScriptProperty

Listing 10.3. Basic closure in PowerShell

Listing 10.4. New-Point function

Listing 10.5. Wrapper for the Out-Default cmdlet

Listing 10.6. Type file for Sum() method extension

Listing 10.7. Updating type data dynamically

Listing 10.8. Creating a class using C#

Listing 10.9. The ExampleModuleScript

Chapter 11. PowerShell remoting

Listing 11.1. Parameterized monitoring script

Listing 11.2. Import-PSSession cmdletsplattingin proxy functionssteppable pipelinesin proxy functionsDefinition of the Get-Bios proxy function

Listing 11.3. ComplexConstrainedConfiguration.ps1

Chapter 12. PowerShell workflows