PowerShellTraps is a collection of some PowerShell traps and oddities shown by demo scripts with workarounds and automated tests. On invoking scripts ensure the current location is set to their directory. For simplicity some of them refer to other files using relative paths. Contributions are welcome, see CONTRIBUTING. See also TESTS.
- Basic
- And-and-or-have-same-precedence
- Break-and-Continue-with-not-matching-label
- Break-and-Continue-without-loop
- Collection-property-enumeration
- Compound-equality-operators
- Count-and-Length-in-Strict-Mode
- Count-and-Length-of-mixed-objects
- Different-kinds-of-null
- Dynamic-switch-parameter
- Enums-are-always-evaluated-to-true
- Errors-of-unusual-type
- Extra-properties-of-IDictionary
- FormatEnumerationLimit
- Function-invoked-like-method
- Invocation-with-odd-paths
- Local-ActionPreference
- Logical-operators-with-collections
- Misleading-error-location
- Missing-ternary-operator
- Null-converted-to-empty-string
- Number-of-returned-objects
- Requires
- Statements-are-not-expressions
- Switch-is-a-looping-construct
- Tempting-wrong-operators
- Too-simple-function-names
- Trap-creates-a-new-scope
- Trap-with-continue
- Trap-with-no-break-or-continue
- Try-and-trap-catch-terminating-errors
- Unexpected-output
- Unexpected-overloaded-method
- Unrolled-collections
- ValidateScript-attribute
- WildcardPattern
- Clixml
- Cmdlets
- Module
- PowerShell.exe
- Exit-code-0-with-Command-syntax-error
- Exit-code-0-with-File-script-error
- Exit-code-5-with-File-1-with-Command
- Exit-code-depends
- Global-and-script-scope
- Interactive-issues-in-v3
- Not-current-version
- Switch-parameter-with-value
- Unexpected-start-location
- Version-must-be-first-parameter
- Version-scriptblock-host-problem