Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

Cmdlet "Set-content" is in conflict with PowerShell built-in cmdlet "set-content" #6

Closed
RichieRoxx opened this issue Jun 12, 2018 · 3 comments
Assignees
Labels

Comments

@RichieRoxx
Copy link
Contributor

Steps to reproduce

When crmpowershell-module is installed other scripts that use "set-content" expect to use the built-in cmdlet of PowerShell while they actually use the "set-content" of crmpowershell which has a different functionality. Example is:

Visual Studio Code Powershell Language Services has a Start-EditorServices.ps1 which uses "set-content" and fails at start: PowerShell/vscode-powershell#1331


Expected behavior

since there is a "set-crmcontent"-cmdlet which does the same, "set-content" could be removed?!


Actual behavior

Environment data

v1.3.1.2

@AMSoftwareNL
Copy link
Owner

The module (AMSoftware.Crm.psd1) contains the setting 'DefaultPrefix=Crm'. The exported Cmdlet is Set-Content but as loaded by the module it should translate to Set-CrmContent. So there aren't to cmdlets (Set-Content and Set-CrmContent). There is only one with an internal name Set-Content, which the module should set to Set-CrmContent.
This doesn't seem to work consistent. After running 'Get-Command -Module AMSoftware.Crm' I see some cmdlets are shown duplicate (with and without prefix) when others are only shown with the prefix.

Next version I will remove the DefaultPrefix in the module and hardcode it in the cmdlet names. This will solve your issue. Expect a new version end of this month.

@AMSoftwareNL AMSoftwareNL self-assigned this Jun 13, 2018
@RichieRoxx
Copy link
Contributor Author

that would be awesome. Thanks for all the effort you put in this!

@AMSoftwareNL
Copy link
Owner

Fixed in v1.4.0.0. Prefix is now hard-coded in Cmdlet name

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants