microsoft / Docker-PowerShell

PowerShell Module for Docker
MIT License
289 stars 87 forks source link

ShouldContinue & ShouldProcess attribute missing in the Cmdlets #171

Open DexterPOSH opened 7 years ago

DexterPOSH commented 7 years ago

Output of $PSVersionTable (from a powershell process):

Name                           Value
----                           -----
PSVersion                      5.1.14393.576
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.576
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Output of ipmo Docker; (module Docker).Version.ToString() (from a powershell process):

0.1.0.111

Steps to reproduce the issue:

  1. Get-Command -Module Docker -ParameterName WhatIf
  2. Get-Command -Module Docker -ParameterName Force ; Get-Command -Module Docker -ParameterName Confirm

What actually happened?:

Throws an error that no matching commands include a parameter named 'whatif' or 'confirm'

What did you expect to happen?: As a best practice while developing cmdlets for PowerShell, it is recommended to Support ShouldProcess & ConfirmImpact cmdlet attributes.

Additional information: Creating a Cmdlet that Modifies the System

DexterPOSH commented 7 years ago

These should be pretty simple fix, let me know if this is up for grabs.

swernli commented 7 years ago

@DexterPOSH Thanks for the feedback. This is definitely up for grabs, and we'd be happy to have the contribution!

DexterPOSH commented 7 years ago

@swernli awesome, I will get started on this then.

DexterPOSH commented 7 years ago

@swernli started working on this, to begin with working on the Remove-* cmdlets from the module. Also, I need your opinion on if I am going down the right approach here. Please take a look on how this looks :- https://github.com/DexterPOSH/Docker-PowerShell/commit/7f639f68a09162f40e88d8692c60d6288a308002

swernli commented 7 years ago

@DexterPOSH Sorry I haven't responded yet, still catching up after vacation. I should be able to take a look soon!

swernli commented 7 years ago

@DexterPOSH Finally got the chance to look over the changes, and the pattern looks good overall. I had a few minor comments that hopefully help. Thanks again for working on this contribution!

DexterPOSH commented 7 years ago

@swernli Thanks for some very good feedback, I will resume the work and keep hitting you with more questions.