Issue #11482 has been updated by Marco Peterseil. Status changed from Needs More Information to Closed
---------------------------------------- Bug #11482: exec powershell scripts return code 1 https://projects.puppetlabs.com/issues/11482 Author: Marco Peterseil Status: Closed Priority: Normal Assignee: Marco Peterseil Category: exec Target version: Affected Puppet version: 2.7.9 Keywords: Branch: i have following ps1 script # test.ps1 New-Item -Path "c:\yabi" -ItemType Dir and following config # windows.pp exec { 'test': command => 'C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe C:/test.ps1', provider => windows, } starting the agent: puppet agent --server puppetmaster --test info: Caching catalog for win-1aol6rc6eer info: Applying configuration version '1324302070' err: /Stage[main]/Windows/Exec[test]/returns: change from notrun to 0 failed: C:/Windows/System32/WindowsPowerShell/v1.0 /powershell.exe C:/test.ps1 returned 1 instead of one of [0] at /etc/puppet/manifests/windows/yabi.pp:21 notice: Finished catalog run in 5.23 seconds if i run the command on powershell, cmd or start-run it is working perfect. so the script is not the problem. the execution policy is also set: PS C:\Users\Administrator> Get-ExecutionPolicy Unrestricted a batch file with the "same" content works fine: # test.bat mkdir C:\yabi starting the agent: PS C:\Users\Administrator> puppet agent --server puppetmaster --test info: Caching catalog for win-1aol6rc6eer info: Applying configuration version '1324302937' notice: /Stage[main]/Windows/Exec[test]/returns: executed successfully notice: Finished catalog run in 4.83 seconds ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32] Windows Server 2008R2 SP1 Powershell V2.0 -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
