Cargando…

PowerShell troubleshooting guide : minimize debugging time and maximize troubleshooting efficiency by leveraging the unique features of the PowerShell language /

The techniques in this book apply to beginners who have just started to learn PowerShell, as well as advanced scripters who have a good grasp of the language.

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Shepard, Micheal (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham, UK : Packt Publishing, 2014.
Colección:Professional expertise distilled.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: PowerShell Primer; Introduction; Cmdlets; The big three cmdlets; Functions; Scripts; Pipelines; How pipelines change the game; What's the fuss about sorting?; Variables; Modules; Further reading; Summary; Chapter 2: PowerShell Peculiarities; PowerShell strings; String substitution; How string substitution goes wrong; Escaping in PowerShell strings; Function output; Pipeline processing; PowerShell error handling; The trap statement; try, catch, and finally statements
  • Non-terminating errorsFurther reading; Summary; Chapter 3: PowerShell Practices; Filter left; Format right; Comment-based help; Using Write-* cmdlets; Write-Host; Output
  • the correct way; What about the other Write-* cmdlets?; Which Write should I use?; Write-Verbose; Write-Debug; Write-Warning; Write-Error; Write-Progress; Further reading; Summary; Chapter 4: PowerShell Professionalism; Naming conventions; Cmdlet and function naming; Parameter naming; Module naming; Variable naming; Modularization; Breaking a process into subtasks; Helper functions; Single responsibility principle
  • Don't repeat codeUnderstanding the process; Version control; Using version control with PowerShell; Unit testing; Rolling your own unit tests; Why is PowerShell testing difficult?; An introduction to Pester; Mocking with Pester; Further reading; Summary; Chapter 5: Proactive PowerShell; Error handling; Error-handling guidelines; Error-handling techniques; Investigating cmdlet error behavior; Catch and release; CmdletBinding(); Common parameter support; SupportsShouldProcess; Parameter name validation; Parameter value validation; Pipeline input; Pipelines and function execution
  • Parameter type transformation#REQUIRES statements; Set-StrictMode and Set-PSDebug -strict; Further reading; Summary; Chapter 6: Preparing the Scripting Environment; Validating operating system properties; Workstation/server version; Operating system version; Putting it all together; Validating service status; Validating disk and memory availability; Validating network connectivity; Using telnet; Using Test-NetConnection; Writing Test-NetConnection in downstream versions; Testing UDP and ICMP connectivity; Validating connectivity prior to implementation ; Putting it all together
  • Further readingSummary; Chapter 7: Reactive Practices
  • Traditional Debugging; Reading error messages; The color problem; Changing console colors; Changing ISE colors; PowerShell profiles; Error message content; Using Set-PSDebug; Debugging in the console; Debugging in the ISE ; Event logs; Listing event logs; Reading event logs; Writing to event logs; The PSDiagnostics module; Using -confirm and -whatif; Reducing input set; Using Tee-Object to see intermediate results; Replacing the foreach loop with the foreach-object cmdlet; Further reading; Summary; Chapter 8: PowerShell Code Smells