PowerShellPracticeAndStyle icon indicating copy to clipboard operation
PowerShellPracticeAndStyle copied to clipboard

The Unofficial PowerShell Best Practices and Style Guide

Results 55 PowerShellPracticeAndStyle issues
Sort by recently updated
recently updated
newest added
trafficstars

It would be nice to have PS Style Guides for classes as well.

What do you think about the pipeline and newlines. ```powershell Get-PSSession | Where-Object { $_.computername -like "*.outlook.com" } | Remove-PSSession ``` ```powershell Get-PSSession | Where-Object { $_.computername -like "*.outlook.com" }...

In the documentation and comments section, there is nothing about including a link to further documentation or the download location. In my experience it would be a best practice and...

Most languages have a few patterns defining template solutions to common problems, along with related terminology to aid in understanding. It would be good to create a section in here...

Does anyone else use (external) configuration files for their modules? How do you wish PowerShell supported that? I looked at a bunch of modules which need configuration (like PSReadLine, PSCX,...

I have found it difficult to find examples on how to properly attribute other's code when they have given permission to reuse. I think it would be nice to have...

enhancement
question
Best Practices

In ERR-01 and ERR-02 you're told to use -ErrorAction on all cmdlets and set ErrorActionPreference around everything else, where needed. This leaves it to the scripter to figure out how...

It really would be nice to have a RegEx part which helps with some traps like: - clarify differences between `-match`, `-imatch`, `-cmatch` - differences while using modifiers like `(?-i)`...

I've already [written about this](https://github.com/PowerShell/PSScriptAnalyzer/issues/362), but it's probably worth having this conversation here. Function parameters are **always** automatically defined in the local scope _and initialized by PowerShell_ to their default...

I searched and didn't see a previous issue for this. Do you think we should recommend using single quotes around any string that doesn't require some type of evaluation? I'd...

wontfix
Style Guide
Discussion