$File = "C:\CostLoads\Book1.xlsx"
$Instance = "xxxxx"
$Database = "DBA_USAGE"
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($File)
foreach($sheet in Get-ExcelSheetInfo $File)
{
$data = Import-Excel -Path $File -WorksheetName $sheet.name | ConvertTo-DbaDataTable
$tablename = $fileName + '-' + $sheet.Name
Write-DbaDataTable -SqlInstance $Instance -Database $Database -InputObject $data -AutoCreateTable -Table $tablename
}
I'm trying to import my xcel file into SQL but receive this message.
--The certificate chain was issued by an authority that is not trusted--