Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScheduledTask: Get-ScheduledTask function name clash with Carbon module #248

Closed
bozho opened this issue Aug 23, 2019 · 1 comment · Fixed by #253
Closed

ScheduledTask: Get-ScheduledTask function name clash with Carbon module #248

bozho opened this issue Aug 23, 2019 · 1 comment · Fixed by #253
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.

Comments

@bozho
Copy link
Contributor

bozho commented Aug 23, 2019

Details of the scenario you tried and the problem that is occurring

We're using DSC resources from both ComputerManagementDsc and Carbon modules.

Carbon implements Get-ScheduledTask function, which is missing the -TaskPath parameter. Functions from ScheduledTask DSC resource call Get-ScheduledTask without importing ScheduledTasks modules, or calling the function using the module name (i.e. ScheduledTasks\Get-ScheduledTask)

This makes it impossible to use or even have installed both modules on the same machine.

Suggested solution to the issue

While this issue might be better addressed in Carbon, it doesn't really hurt making ScheduledTask code more specific about which Get-ScheduledTask function it's using.

We could either make the code explicitly import the ScheduledTasks module, or use the "long" form to call overlapping functions (I think it's just `Get-ScheduledTask, but I can review)

I'd be happy to submit a patch.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

The operating system the target node is running



OsName               : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsBuildLabEx    : 14393.3024.amd64fre.rs1_release.190530-2002
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Version and build of PowerShell the target node is running


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

Version of the DSC module that was used ('dev' if using current dev branch)

6.5.0.0

@bozho bozho changed the title ScheduledTask: Get-ScheduledTask fnuction name clash with Carbon module ScheduledTask: Get-ScheduledTask function me clash with Carbon module Aug 23, 2019
@bozho bozho changed the title ScheduledTask: Get-ScheduledTask function me clash with Carbon module ScheduledTask: Get-ScheduledTask function name clash with Carbon module Aug 23, 2019
@PlagueHO PlagueHO added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Aug 23, 2019
@PlagueHO
Copy link
Member

Hi @bozho - thanks for raising this. Would be happy to accept a PR with the change of adding the module name to the function name call (e.g. ScheduledTasks\Get-ScheduledTask).

bozho added a commit to bozho/ComputerManagementDsc that referenced this issue Aug 27, 2019
PlagueHO added a commit that referenced this issue Sep 4, 2019
[#248] Get-ScheduledTask calls fix to avoid name clashes with Carbon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants