PowerShell script exchange
Post Reply
iyadomry
Lurker
Posts: 2
Liked: never
Joined: Apr 23, 2021 2:25 pm
Full Name: Iyad Omry
Contact:

powershell show different info

Post by iyadomry »

HI,
If I run the command get-vbrjob on the PowerShell that build in the veeam console I got different format from the PowerShell that I run from windows powershell
how to get the same formate ??

example:
PowerShell veeam toolkit:

Job Name Type State Last Result Description
-------- ---- ----- ----------- -----------

powershell windows build in:

LogNameMainPart
FreeBackupImpl
IsFree
UserCryptoKey
Id
Info
JobType
SourceType
etc.
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: powershell show different info

Post by jhoughes »

If you have launched from the GUI or imported in the snap-in/module (depending on you version of Veeam), the results of Get-VBRJob should be the same.

PowerShell (completely independent of Veeam) works based on formatting XML files which control the default views & output of objects. If these objects aren't displaying the same, then something is not being loaded properly in your PowerShell console.

What version of Veeam are you running, and how are you loading the Veeam cmdlets when not launching from the GUI?
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
iyadomry
Lurker
Posts: 2
Liked: never
Joined: Apr 23, 2021 2:25 pm
Full Name: Iyad Omry
Contact:

Re: powershell show different info

Post by iyadomry »

Hi,
I am using Veeam 9.4 update 4, and I am loading the PowerShell from the batch script server 2016.
let me explain my self with more details:
I build batch script call powershell which run the command "get-vbrjob" and send the data to my email
here is real example:

powershell loaded from veeam :

Code: Select all

PS C:\Users\administrator.> get-vbrjob -name PW-KWDS01-10G

Job Name                  Type            State      Last Result  Description
--------                  ----            -----      -----------  -----------
PW-KWDS01-10G             VMware Backup   Stopped    Success      Created by \administrator at 1/2/2019 9:12 PM.
powershell loaded from batch script call powershell script:

Code: Select all

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Users\administrator.> Add-PSSnapin VeeamPSSnapin
PS C:\Users\administrator.> get-vbrjob -name PW-KWDS01-10G

LogNameMainPart              : 
FreeBackupImpl               :
IsFree                       : 
UserCryptoKey                :
Id                           : 
etc.
jhoughes
Veeam Vanguard
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: powershell show different info

Post by jhoughes »

Please paste the entire scripts that you are using (both the batch script and PowerShell script), as this appears to just be an issue with your scripts.
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion
Talom
Enthusiast
Posts: 43
Liked: 6 times
Joined: Oct 21, 2014 7:56 am
Contact:

Re: powershell show different info

Post by Talom »

You can format the object by using Format-Table https://docs.microsoft.com/en-us/powers ... rshell-7.1
BACKUP EAGLE® Developer
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: powershell show different info

Post by oleg.feoktistov »

@Talom, the question is rather about discrepancy in default output formatting between powershell console called from VBR and windows powershell called directly. As Joe mentioned, if everything is loaded properly, there should be no difference. Formatting cmdlets could be a workaround though. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests