PowerShell script exchange
normunds
Novice
Posts: 5 Liked: never
Joined: Nov 26, 2014 12:54 pm
Full Name: Normunds
Contact:
Post
by normunds » Jan 19, 2017 9:01 am
this post
Hi!
Veeam B&R version 9.5.0.711
Command
Code: Select all
(Get-VBRJob -Name $jobname).TargetDir
does not return "D:\FolderName" anymore. I get only
Is this a bug or something is not correct with my local powershell? I think this issue is after B&R 9.5 upgrade.
Any suggestions?
tdewin
Veeam Software
Posts: 1838 Liked: 661 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:
Post
by tdewin » Jan 19, 2017 9:35 am
1 person likes this post
Might consider
Code: Select all
$job = (Get-VBRJob -Name $jobname)
$job.GetTargetRepository()
normunds
Novice
Posts: 5 Liked: never
Joined: Nov 26, 2014 12:54 pm
Full Name: Normunds
Contact:
Post
by normunds » Jan 19, 2017 10:28 am
this post
tdewin wrote: Might consider
Code: Select all
$job = (Get-VBRJob -Name $jobname)
$job.GetTargetRepository()
Thank you! I got correct result with:
Code: Select all
($job.GetTargetRepository()).FriendlyPath
But same issue with:
Based on my previous powershell experience, this command doesn't work as expected
veremin
Product Manager
Posts: 20689 Liked: 2384 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Jan 19, 2017 11:22 am
this post
Not sure what's wrong in your case. For me both parameters (.Path, .FriendlyPath) work flawlessly. Anyway, glad to hear you've found the way to achieve your goal.
final
Enthusiast
Posts: 35 Liked: 13 times
Joined: Aug 14, 2016 7:19 pm
Contact:
Post
by final » Oct 02, 2021 7:51 am
this post
Just stumbled over this issue. The TargetDir-Property is not a string (Get-VBRJob -Name $jobname | select TargetDir might suggest); it's an object of Type CLegacyPath that has only one Property IsVbm. What you're probably interested in is it's ToString() Method.
So, what you probably want is (Get-VBRJob -Name $jobname).TargetDir.ToString()
Users browsing this forum: No registered users and 38 guests