DscResources icon indicating copy to clipboard operation
DscResources copied to clipboard

Support -AllowClobber

Open arcotek-ltd opened this issue 7 years ago • 7 comments

Original PS cmdlets have the -AllowClobber switch. Can this be ported to this DSC resource.

A command with name 'Add-RoleMember' is already available on this system. This module 'SqlServer' may override the existing commands. If you still want to install this module 'SqlServer', use -AllowClobber parameter.
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:) [], CimException
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
    + PSComputerName        : localhost
 
VERBOSE: [AUCADN102002052]: LCM:  [ End    Set      ]  [[PSModuleResource]SqlServerPSModule]  in 39.9870 seconds.
The PowerShell DSC resource '[PSModuleResource]SqlServerPSModule' with SourceInfo 'C:\Temp\InstallSqlServerPSModule.ps1::5::5::PSModuleResource' threw one or more non-terminating errors while running the Set functionality. 
These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : localhost
 
VERBOSE: [AUCADN102002052]: LCM:  [ End    Set      ]
The SendConfigurationApply function did not succeed.
    + CategoryInfo          : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : MI RESULT 1
    + PSComputerName        : localhost
 
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 53.022 seconds

Small point, shouldn't this resource be called cPowerShellModule, where 'c' stands for community as it is in the public domain?

BTW. Thanks for publishing this.

arcotek-ltd avatar Oct 05 '17 10:10 arcotek-ltd

Thanks for your feedback. AllowClobber would be a great addition. I won't be able to add this in the very near future though (upcoming conferences). If you like, please open a Pull Request and I'm happy to merge it in.

To your naming comment: No, I don't agree with that practice. I agree that the name isn't perfect, but the c Prefix, just like the x, has always been a bad idea.

davidobrien1985 avatar Oct 06 '17 08:10 davidobrien1985

Hello, I submitted a pull request for this issue. Can you please review?

Thanks.

drryu avatar Jan 09 '18 18:01 drryu

Is this now released somewhere?

dazinator avatar Jul 24 '18 16:07 dazinator

When will this be push to the powershell gallery?

ricohomewood avatar Mar 12 '19 08:03 ricohomewood

Will this be pushed to PowerShell Gallery?

This is the only DSC resource I have found to import modules with AllowClobber.

mjcarrabine avatar Dec 26 '19 20:12 mjcarrabine

@davidobrien1985 would you publish the latest module version to psgallery please ? :)

jbpaux avatar Mar 31 '21 18:03 jbpaux

@davidobrien1985 would you publish the latest module version to psgallery please ? :)

robwafle avatar Jun 09 '21 16:06 robwafle