I’ve created a DSC Custom Resource in C# that will be used to help deploy our product (it’s the first of several as we have some complex configuration files that need to be rendered). As I am working out the DSC solution, however, we continue to deploy manually to customer sites (using an .msi and then manually editing configuration files). Obviously, that’s not in the spirit of automation, and we do get frequent mistakes.
I would like to use the same code and deploy as a “standard” PowerShell cmdlet, so that I can sign it and use it on a customer’s machine the old fashioned way. The Get/Set/Test naming convention for the DSC class is not going to be pretty for this purpose, and there are several folks doing the install that aren’t necessarily PowerShell saavy, so I need to make this as transparent as possible.
Is there a way to reuse the code as both DSC & traditional Module, and still preserve the PowerShell attributes (i.e. I lose WriteVerbose unless I inherit from PSCmdlet)? Or is it considered better form to just duplicate the code base (a developer’s no-no)?