PowerShell script exchange
Post Reply
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Blocks skipped

Post by masonit »

Hi

When using options "exclude swap file blocks" and "exclude deleted file blocks" I can see in the job statistics:

Deleted file blocks skipped: 797,0 MB
Swap file blocks skipped: 367,0 MB

I have found this info with powershell using Get-VBRTaskSession (Logger.GetLog().UpdatedRecords). But is it possible somehow to get the value part in the string (797,0) as a real value? Want to collect this info and don't want to interpret a string.

\Masonit
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Blocks skipped

Post by veremin »

You need to parse the given string, get number of skipped blocks and then convert it to integer, using similar approach. Thanks!
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Blocks skipped

Post by masonit »

Ok, thanks.

\Masonit
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Blocks skipped

Post by veremin »

You're welcome. Let us know, should more assistance be needed. Thanks!
tdewin
Veeam Software
Posts: 1818
Liked: 655 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Blocks skipped

Post by tdewin » 1 person likes this post

Hi,

Here is some sample code how you could parse out the data:

Code: Select all

$datastr = "Deleted file blocks skipped: 797,0 MB"
if ($datastr -match ": ([0-9,]+) ([GMK])B") {
	<#if you the system uses a dot, you can use replace to change , to . $data = [double]$Matches[1].Replace(',',".")#>
	$data = [double]$Matches[1]
	$so = "","K","M","G","T","P"
	$databytes = $data*[Math]::Pow(1024,$so.IndexOf($Matches[2]))
	
	write-host $databytes
}
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests