AsBuiltReport.Veeam.VBR
AsBuiltReport.Veeam.VBR copied to clipboard
Report hangs if there are offline object in the Veeam Inventory
Bug description
When using the Find-VBRViEntity cmdlet there are times where the report hangs for a long time if there are offline objects in the vSphere or HyperV inventory.
Command-line input
$Datastores = Find-VBRViEntity -DatastoresAndVMs -ErrorAction SilentlyContinue | Where-Object {($_.type -eq "Datastore")}
Steps to reproduce
.1 Run the report on a site with offline entity in the inventory
Expected behaviour
Find a way to set a timeout for the cmdlet. This will prevent the report from hanging for a long time.
Screenshots
No response
Operating System
Windows OS
PowerShell Version
Name Value
---- -----
PSVersion 5.1.19041.3693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.3693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
PowerShell Modules
Name Version
---- -------
AsBuiltReport.Veeam.VBR 0.8.4
AsBuiltReport.Core 1.3.0
PScribo 0.10.0
Additional Context
No response
Before submitting
- [X] I have read and followed the bug reporting guidelines.
- [X] I have read the documentation, and referred to the known issues before submitting this bug report.
- [X] I have checked for previously opened & closed issues before submitting this bug report.
$Timeout = 60
$job = Start-Job -ScriptBlock {
# Here's where you put the stuff that might hang or take too long.
}
$JobTimer = 0
# Wait for the number of seconds in the $Timeout variable before giving up on the job.
while ($job.State -eq "Running" -and $JobTimer -le $Timeout) {
$JobTimer = $JobTimer + 1
sleep -Seconds 1
}
if ($job.State -eq "Completed" -and $job.HasMoreData -eq $true) {
$job | Receive-Job
}
Unable to provide a solutions for this issue.