dsccommunity / xRobocopy

DSC Module to automate Robocopy transfers
MIT License
54 stars 15 forks source link

Add Ensure read only property and return it from Get-TargetResource #6

Closed KarolKaczmarek closed 8 years ago

KarolKaczmarek commented 9 years ago

A common pattern for resources which operate on source/destination is to add Ensure property (even if it's read only if we don't support removal) similarly to File resource. Get-TargetResource would return Source and Destination with values specified in the configuration (always, not only if they exist or not - as it happens currently) and Ensure would be set to either "Present" or "Absent" based on the current state of the resource on the given node.

mgreenegit commented 9 years ago

Although I follow the pattern, is 'Ensure' the best term if we the purpose is to be an indicator? Perhaps a ready only property 'Status' or 'State' or 'Present' with a Boolean value?

KarolKaczmarek commented 9 years ago

I agree this is not the best term for it, but not sure if we should be inventing new term for same thing now once we use it in so many places.

@joeyaiello @HemantMahawar thoughts?

Arturas-K commented 8 years ago

@KarolKaczmarek this can be closed in #16 PR i have added readonly parameter $Ensure, that is returned by Get function.

KarolKaczmarek commented 8 years ago

Thanks @Arturas-K