[bool](Get-Command -Name "Invoke-Sqlcmd" -ErrorAction SilentlyContinue)

The above command just simply interprets the result of Get-Command as a boolean. Essentially [bool] will see any nonempty string as true and any empty string as false (see comment by Hemant).