PowerShell script exchange
Post Reply
Rmachado
Service Provider
Posts: 17
Liked: 4 times
Joined: Dec 15, 2016 11:39 pm
Contact:

Get the output of a powershell script into the job details

Post by Rmachado »

Hello.

I have a pre-script script in powershell that checks if a file is not open before starting the backup. If its open, it will fail with exit code.

It works ok, but i would like to know if i can costomize the output in "Details" in the job log.

Today i have this :

Running pre-freeze script
Error: Script finished execution with unexpected exit code: 1

Is there a way to costomize the output in the job ? I have the part of the job that gives the error bellow

Code: Select all

Write-Error -Message "Error : File open"
    Return 1
    exit
Thank you!

HannesK
Veeam Software
Posts: 6566
Liked: 1002 times
Joined: Sep 01, 2014 11:46 am
Location: Austria
Contact:

Re: Get the output of a powershell script into the job details

Post by HannesK »

Hello,
the only way I see is that you write to the job.log file directly. But that's complicated because the pre-script in application aware processing runs inside the VM and not on the backup server.

Best regards,
Hannes

oleg.feoktistov
Veeam Software
Posts: 639
Liked: 223 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get the output of a powershell script into the job details

Post by oleg.feoktistov »

Hannes is right. There is no possibility to customise it now. Also, I don't see a a hardcoded workaround that would work. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests