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

xPackage: dsc_xpackage parameter issues #762

Open
marvin5881 opened this issue Oct 2, 2023 · 3 comments
Open

xPackage: dsc_xpackage parameter issues #762

marvin5881 opened this issue Oct 2, 2023 · 3 comments
Labels
external The issue cannot be resolved within the DSC Resource Kit. question The issue is a question.

Comments

@marvin5881
Copy link

Problem description

Powershell is having an issue with a certain parameter and is requesting to use one that is not a part of the Dsc_xpackage resource according to the documentation. It seems to want me to use the Parameter "Path" but the closest thing I can see in the documentation is "dsc_path"

Verbose logs

no parameter named 'path' on Dsc_xpackage[sophos_install_agent]

dsc_xpackage: PowerShell DSC resource DSC_xPackageResource failed to execute Get-TargetResource functionality with error message: The specified Path 'D:\CMMain8' does not appear to specify an EXE or MSI file and as such is not supported.
Parameter name: Path

DSC configuration

dsc_xpackage { 'sophos_install_agent':
        dsc_ensure    => present,
        dsc_name      => 'Sophos Endpoint Agent',
        #dsc_productid => '',
        dsc_path      => $test,
        dsc_arguments => '--quiet',
        require       => Reboot['reboot_when_refreshed_exclude_wau_rename'],
        notify        => Reboot['sophos_reboot_when_refreshed'],
      }

Suggested solution

Attempt to replicate issue in a different envirionment.

Operating system the target node is running

Windows Server 2019

PowerShell version and build the target node is running

PowerShell 7

xPSDesiredStateConfiguration version

9.1.0-0-4
@johlju
Copy link
Member

johlju commented Oct 3, 2023

I think this might be an issue related to Puppet?

This is tested using LCM in an integration test, and very much uses a parameter Path

xPackage Package1
{
Path = '$script:msiLocation'
Ensure = "Present"
Name = '$script:packageName'
ProductId = '$script:packageId'
}

But it might be related that Puppet converts dsc_path to the resource parameter Path?

@johlju johlju changed the title Dsc_xpackage parameter issues xPackage: dsc_xpackage parameter issues Oct 3, 2023
@marvin5881
Copy link
Author

marvin5881 commented Oct 3, 2023

Yes, I am using Puppet to automate DSC via the module provided by this community.
https://forge.puppet.com/modules/dsc/xpsdesiredstateconfiguration/reference#dsc_xpackage

Path isn't something that I can configure directly with Puppet but it would make sense that it's converted from dsc_path. I'm not quite sure if it matters that dsc_path is labeled as a property rather than a parameter.

Is there a workaround for this?

Thank you so much for reaching out!

@johlju
Copy link
Member

johlju commented Oct 3, 2023

I think you do best by reaching out to a Puppet forum as this cannot be fixed in this repo. You could also ask in the DSC-channel in Slack/Discord to see if there are any Puppet users that can help: https://dsccommunity.org/community/contact/

@johlju johlju added question The issue is a question. external The issue cannot be resolved within the DSC Resource Kit. labels Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue cannot be resolved within the DSC Resource Kit. question The issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants