Skip to content

Commit 5edf06d

Browse files
committed
Fix error You cannot call a method on a null-valued expression
1 parent 5b718d2 commit 5edf06d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/Private/Get-AbrOntapVserverVolumeSnapshotHealth.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ function Get-AbrOntapVserverVolumeSnapshotHealth {
2828

2929
process {
3030
try {
31+
$SnapshotDays = 7
32+
$Now = Get-Date
3133
$VserverFilter = Get-NcVol -VserverContext $Vserver -Controller $Array | Where-Object {$_.JunctionPath -ne '/' -and $_.Name -ne 'vol0'}
3234
$SnapShotData = get-ncsnapshot -Volume $VserverFilter -Controller $Array | Where-Object {$_.Name -notmatch "snapmirror.*" -and $_.Created -le $Now.AddDays(-$SnapshotDays)}
3335
if ($SnapShotData) {
3436
Section -Style Heading4 "HealthCheck - Volumes Snapshot" {
3537
Paragraph "The following section provides the Vserver Volumes Snapshot HealthCheck on $($SVM)."
3638
BlankLine
37-
$SnapshotDays = 7
38-
$Now = Get-Date
3939
$VserverObj = @()
4040
foreach ($Item in $SnapShotData) {
4141
$inObj = [ordered] @{

0 commit comments

Comments
 (0)