private/Test-Null.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<#
    .SYNOPSIS
        Tests to see if a value is a SQL NULL or not

    .DESCRIPTION
        Returns $true if the value is a SQL NULL.

    .PARAMETER value
        The value to test

    

    .EXAMPLE
        PS C:\> Test-NULL $row.columnname

    
    .INPUTS
        None.
        You cannot pipe objects to New-Connection

    .OUTPUTS
        Boolean

#>

function Test-NULL{
    param([Parameter(Mandatory=$true)]$value)
    return  [System.DBNull]::Value.Equals($value)
  }