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

Missing invoke params for xprinterport #258

Open
unkinected opened this issue Oct 13, 2023 · 0 comments
Open

Missing invoke params for xprinterport #258

unkinected opened this issue Oct 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@unkinected
Copy link

unkinected commented Oct 13, 2023

Describe the Bug

Very similar to issue 105 here, it seems I'm missing some parameters in the @InvokeParams hash that gets passed to Invoke-DscResource. One of these missing parameters is mandatory for the get method of the DSC module and thus my puppet run is failing.

Specifically, here is my invokeparams hash when running puppet in debug mode:

$InvokeParams = @{Name = 'xPrinterPort'; Method = 'get'; Property = @{name = '192.168.252.101'}; ModuleName = @{ModuleName = 'C:/ProgramData/PuppetLabs/puppet/cache/lib/puppet_x/xprintermanagement/dsc_resources/xPrinterManagement/xPrinterManagement.psd1'; RequiredVersion = '1.0.0.2'}}

Here's my manifest (values are made up):

dsc_xprinterport { "192.168.1.1": dsc_name => "192.168.1.1", dsc_ensure => "Present", dsc_printerhostaddress => "192.168.1.1", dsc_type => 'TCP/IP', }

And here are the Get-TargetResource parameters for the xPrinterPort.ps1 file:

`
param (
## Specifies the name of the printer
[Parameter(Mandatory)]
[System.String] $Name,

    ## Specifies the name of the printer driver for the printer
    [Parameter(Mandatory)] [ValidateSet('Local','TCP/IP')]
    [System.String] $Type, 

    ## Specifies whether or not the printer is published in the network directory service
    [Parameter()]
    [System.String] $PrinterHostAddress,       
    
    [Parameter()] [ValidateSet('Present','Absent')]
    [System.String] $Ensure = 'Present'
)

`

You can see that $Type is mandatory, but it's not being passed into the InvokeParams hash.

Expected Behavior

I would expect the parameters that I specify in my puppet manifest to be passed to the DSC module as necessary.

Environment

  • Puppet Version: 7.26.0
  • Platform: Windows Server 2022

I'm hoping this is a simple fix since a very similar issue was also reported, identified, and fixed here: #105.

@unkinected unkinected added the bug Something isn't working label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant