# Introduction

## Foreword

If you scan through code projects on [PoshCode](https://github.com/PoshCode) or the [Microsoft Learn Code Samples Gallery](https://learn.microsoft.com/en-us/samples/browse/?languages=powershell), it will be immediately apparent that people in the PowerShell community have vastly different ideas about what's "right and wrong" in the world of PowerShell scripting.

Over the years several attempts have been made to arrive at a consensus, most notably the "Great Debate" series of blog posts on [PowerShell.org](https://powershell.org/?s=great+debate) following the 2013 Scripting Games, which outlined some of the more controversial issues and asked for community discussions.

This project has been created, in part, as a public place to continue those debates as well as to document the consensus of the community when we *do* arrive at a consensus.

Remember that best practices are not hard-and-fast rules. We don't even consider them as solid as the [Style Guide](/powershell-practice-and-style/style-guide/introduction.md) rules. They are the things you should *usually* do as a starting point, and should deviate from when it's appropriate.

One final note about these Best Practices: the perspective of these guidelines has so-far been strongly influenced by system administrator practitioners, less-so by language geeks and developers. We're trying to balance that and provide perspective, but when it comes to best practices, we definitely allow the experience of administrators to drive what the PowerShell community considers best and worst practices -- so if you are working from a different perspective, you'll have to take all of this with a grain of salt.

## Table of Contents

* [Naming Conventions](/powershell-practice-and-style/best-practices/naming-conventions.md)
* [Building Reusable Tools](/powershell-practice-and-style/best-practices/building-reusable-tools.md)
* [Writing Parameter Blocks](https://github.com/PoshCode/PowerShellPracticeAndStyle/blob/master/Best-Practices/Writing-Parameter-Blocks.md)
* [Output and Formatting](/powershell-practice-and-style/best-practices/output-and-formatting.md)
* [Error Handling](/powershell-practice-and-style/best-practices/error-handling.md)
* [Performance](/powershell-practice-and-style/best-practices/performance.md)
* [Security](/powershell-practice-and-style/best-practices/security.md)
* [Language, Interop, and .NET](/powershell-practice-and-style/best-practices/language-interop-and-.net.md)
* [Metadata, Versioning, and Packaging](/powershell-practice-and-style/best-practices/metadata-versioning-and-packaging.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://poshcode.gitbook.io/powershell-practice-and-style/best-practices/introduction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
