12

Debugging and Troubleshooting Windows Server

This chapter covers the following recipes:

  • Using PSScriptAnalyzer
  • Using Best Practices Analyzer
  • Exploring PowerShell Script Debugging
  • Performing BASIC Network Troubleshooting
  • Using Get-NetView to Diagnose Network Issues

Introduction

You can think of debugging as the art and science of removing bugs from your PowerShell scripts. A script may not do what you or your users want, both during the development of a script and after you deploy the script into production. Troubleshooting is a process you go through to determine why your script is not doing what you want, and then it helps you resolve your issues.

There are three broad classes of problems that you encounter:

  • Syntax errors
  • Logic errors ...

Get Windows Server Automation with PowerShell Cookbook - Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.