Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-5228

Powershell : Execs fail with InvalidArgument: [Invoke-Expression] ParameterBindingException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • None
    • powershell
    • None
    • MODULES Bug Template
    • Windows
    • Needs Assessment
    • Needs Assessment

    Description

      Basic Info
      Module Version: Powershell 2.1.1
      Puppet Version: 4.9.4
      OS Name/Version: Windows 2012r2

      Describe your issue in as much detail as possible...
      Creating a manifest (exec.pp) with:

        exec { 'ExportSecurityPolicy':
          command  => 'secedit /export /cfg c:\windows\temp\secpol.cfg.orig',
          provider => powershell,
          creates  => 'c:/windows/temp/secpol.cfg.orig',
        }
      

      And trying to apply it with `puppet apply exec.pp` fails with the errors in the attachment.
      Doing the same with running hte command in the exec in a powershell window works.

      Debug run log attached.

      Resolution: I could get things to work again by downgrading to version 2.0.3 of the module.

      Attachments

        Issue Links

          Activity

            People

              qa qa
              carthik Carthik Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support