mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Windows pslint: Re-enable PSPossibleIncorrectComparisonWithNull (#55065)
* pslint fixes * Fix up remaining sanity issues * now fix silly errors I made
This commit is contained in:
parent
a2eb227970
commit
025e9afe58
38 changed files with 269 additions and 272 deletions
|
@ -76,7 +76,7 @@ Function Convert-CollectionToList($collection) {
|
|||
}
|
||||
|
||||
Function Compare-Values($current, $new) {
|
||||
if ($current -eq $null) {
|
||||
if ($null -eq $current) {
|
||||
return $true
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ Function Convert-ToPropertyValue($pool, $attribute_key, $attribute_value) {
|
|||
foreach ($key in $attribute_key_split) {
|
||||
$attribute_meta = $parent.Attributes | Where-Object { $_.Name -eq $key }
|
||||
$parent = $parent.$key
|
||||
if ($attribute_meta -eq $null) {
|
||||
if ($null -eq $attribute_meta) {
|
||||
$attribute_meta = $parent
|
||||
}
|
||||
}
|
||||
|
@ -152,11 +152,11 @@ Function Convert-ToPropertyValue($pool, $attribute_key, $attribute_value) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# Try and cast the variable using the chosen type, revert to the default if it fails
|
||||
Set-Variable -Name casted_value -Value ($value -as ([type] $attribute_meta.TypeName))
|
||||
if ($casted_value -eq $null) {
|
||||
if ($null -eq $casted_value) {
|
||||
$value
|
||||
} else {
|
||||
$casted_value
|
||||
|
@ -167,7 +167,7 @@ Function Convert-ToPropertyValue($pool, $attribute_key, $attribute_value) {
|
|||
}
|
||||
|
||||
# Ensure WebAdministration module is loaded
|
||||
if ((Get-Module -Name "WebAdministration" -ErrorAction SilentlyContinue) -eq $null) {
|
||||
if ($null -eq (Get-Module -Name "WebAdministration" -ErrorAction SilentlyContinue)) {
|
||||
Import-Module WebAdministration
|
||||
$web_admin_dll_path = Join-Path $env:SystemRoot system32\inetsrv\Microsoft.Web.Administration.dll
|
||||
Add-Type -Path $web_admin_dll_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue