private/ConvertTo-SqlSafe.ps1

function ConvertTo-SqlSafe {
    [CmdletBinding()]
    param(
        [AllowNull()]
        [AllowEmptyString()]
        [string]$Value
    )

    ($Value ?? "").Replace("'", "''")
}