Commit Graph

3 Commits

Author SHA1 Message Date
oceans-of-time
df81ca0319 Update powershell.instructions.md (#1125)
* Update powershell.instructions.md

## Description

### Error Handling

- Update to the `powershell.instructions.md` file. Now includes less error handling in the examples. This means when using the instructions file the output script contains less of the structured error handling, however the output scripts are easier for beginners and powershell novices to read and understand.

### Switch parameter

- Updates to using the switch parameters should now prevent default values data type being a bool
- Using no default value is the way in PowerShell. Defaults to a false value and shouldn't be set to a true value. Although a note has been added to show the correct syntax that requires type casting

### Examples updates
- Now includes a better demonstration of using the `WhatIf` parameter via `$PSCmdlet.ShouldProcesss`
- Full Example: End-to-End Cmdlet Pattern updated with the `$Force` & `$PSCmdlet.ShouldContinue` pattern

* Update instructions/powershell.instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update instructions/powershell.instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update instructions/powershell.instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update ShouldProcess and ShouldContinue guidance

Clarified ShouldProcess and ShouldContinue usage in PowerShell instructions.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-09 09:55:07 +10:00
oceans-of-time
897d61b03f fix: improve error handling in PowerShell guidelines (#280)
Update error handling examples to use $PSCmdlet.WriteError() and
$PSCmdlet.ThrowTerminatingError() instead of Write-Error and throw for better PowerShell cmdlet integration.
2025-10-08 11:18:27 +11:00
Kenny White
c3869d8c7b First add of PowerShell instructions (#55)
* First add of PowerShell instructions

* Update instructions/powershell.instructions.md

* Update instructions/powershell.instructions.md

---------

Co-authored-by: Aaron Powell <me@aaron-powell.com>
2025-07-07 10:04:43 +10:00