move check values to left side of comparison
This commit is contained in:
@@ -22,7 +22,7 @@ Function Test-ItemProperty {
|
||||
param([Parameter(Mandatory=$true)][string]$Path,[Parameter(Mandatory=$true)][string]$Name)
|
||||
Try {
|
||||
$test = Get-ItemProperty -Path $Path -Name $Name -ErrorAction SilentlyContinue
|
||||
If (($test -eq $null) -or ($test.Length -eq 0)) { Return $false } Else { Return $true }
|
||||
If (($null -eq $test) -or ($test.Length -eq 0)) { Return $false } Else { Return $true }
|
||||
}
|
||||
Catch { Return $false }
|
||||
}
|
||||
@@ -59,7 +59,7 @@ Function Get-ItemPropertyInfo {
|
||||
|
||||
## Make sure $formatstring has a value, if not just try to cast directly to a datetime
|
||||
Try {
|
||||
If ( $formatstring -eq $null ) {
|
||||
If ( $null -eq $formatstring ) {
|
||||
$date = [datetime]$retval
|
||||
} Else {
|
||||
$date = [datetime]::ParseExact($retval,$formatstring,$null)
|
||||
|
||||
Reference in New Issue
Block a user