# exec and PowerShell command

Hi, I'm trying to run this code:

exec {
"run_backup_${db}" : command => "invoke-sqlcmd -Username${sql_user} -Password ${sql_pass} -ErrorAction Stop -serverinstance${db_host} -database master -Query ${query} -QueryTimeout 0 -OutputSqlErrors 1", timeout => 600, logoutput => true, creates => "${db_back_path1}\\\${db}.bak",
provider    => powershell;
}

When I checked the log, I noticed that I get this message: returned 1 instead of one of [0] (this isn't informative message...)

if I run this command from PowerShell (not with puppet) I get this message: "invoke-sqlcmd : BACKUP DATABASE permission denied in database x" This is the message that I want to get from puppet...

Does someone know how can I display the original message (the same message that I get in PowerShell prompt)?

Thanks a lot!

edit retag close merge delete