Import Xcel file

  • $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--

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply