title: Puppet exec a command before the package is installed
body: <p>I am trying to run a power shell script just before the Pacakage starts installing an msi installer. The script cleans up certain un-managed resources that would block installer.
  What I tried is, </p>
  
  <pre><code>file { 'c:\Test\cleanup.ps1.file' :
      path               =&gt; 'c:\Test\cleanup.ps1',
      ensure             =&gt; present,
      source             =&gt; 'puppet:///modules/test/cleanup.ps1',
      source_permissions =&gt; ignore,
    }
    exec { 'c:\Test\cleanup.ps1.file':
      refreshonly =&gt; true,
      provider    =&gt; powershell,
    }
    package { 'ServiceInstaller':
      ensure  =&gt; $version,
      require =&gt; [Package['Service1Installer'],Exec['c:\Test\cleanup.ps1']],
    }
  </code></pre>
  
  <p>But require attribute doesn't fire the command. Could someone please help me to achieve this behaviour.
  There is this notify command, that would send a EXEC notification, but that happens after the installation. What I need is before the installation. Thanks in advance.</p>