I'm trying to create a SQL Server database, and I get this error
Exception calling ".ctor" with "2" arguments error.
I'm also supposed to create a table from a csv, but I'm executing the code in segments first to make sure I'm doing it right.
Import-Module -Name sqlps -DisableNameChecking
$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(localhost)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database($srv, "Test_Database")
$db.Create()
Write-Host $db.Name "created" $db.CreateDate
.(just a dot),(local)(with the parenthesis), orlocalhost(without any parens) - your spelling of(localhost)is not valid