Skip to content

Commit 37120e7

Browse files
committed
Fix PSScriptAnalyzer: move $null to left side of comparisons
1 parent 4ae02da commit 37120e7

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/Check-All.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ if ($Stats) {
191191
$up = $null
192192
}
193193

194-
if ($up -ne $null) {
194+
if ($null -ne $up) {
195195
$down = $total - $up
196196
"{0} total machines found, {1} reachable, {2} unreachable, {3:p1} reachability" -f $total, $up, $down, ($up / [double]([math]::Max($total, 1))) | Write-Host
197197
}

scripts/Check-Clients.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ if ($Stats) {
174174
$up = $null
175175
}
176176

177-
if ($up -ne $null) {
177+
if ($null -ne $up) {
178178
$down = $total - $up
179179
"{0} total, {1} reachable, {2} unreachable, {3:p1} reachability" -f $total, $up, $down, ($up / [double]([math]::Max($total, 1))) | Write-Host
180180
}

scripts/Check-Servers.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ if ($Stats) {
194194
$up = $null
195195
}
196196

197-
if ($up -ne $null) {
197+
if ($null -ne $up) {
198198
$down = $total - $up
199199
"{0} total, {1} reachable, {2} unreachable, {3:p1} reachability" -f $total, $up, $down, ($up / [double]([math]::Max($total, 1))) | Write-Host
200200
}

0 commit comments

Comments
 (0)