DateTime to SQL

$date.ToString("yyyy-MM-dd HH:mm:ss.fff")
Details
Format a DateTime value in the SQL format

Example
PS C:\> $Date = Get-Date
>> $date.ToString("yyyy-MM-dd HH:mm:ss.fff")

2019-03-28 11:05:58.440