Capturing output/error when invoking PowerShell script
问题 I am trying to invoke a PowerShell script from Puppet. The issue is even if the PowerShell script fails on remote box, it still shows successful run as shown below: Notice: /Stage[main]/Main/Node[dev.abc.com]/Exec[Check UAC]/returns: executed successfully Content of my node block in site.pp : exec { 'Check UAC': command => '& C:\temp\check_uac.ps1', provider => powershell, logoutput => 'on_failure', } The script failed when I tried running from PowerShell console stating that execution policy