diff --git a/ImportExcel.psd1 b/ImportExcel.psd1 index 8a267c3..8143435 100644 --- a/ImportExcel.psd1 +++ b/ImportExcel.psd1 @@ -64,6 +64,7 @@ Check out the How To Videos https://www.youtube.com/watch?v=U3Ne_yX4tYo&list=PL5 'Import-USPS', 'Invoke-AllTests', 'Invoke-Sum', + 'Invoke-ExcelQuery', 'Join-Worksheet', 'LineChart', 'Merge-MultipleSheets', @@ -80,6 +81,7 @@ Check out the How To Videos https://www.youtube.com/watch?v=U3Ne_yX4tYo&list=PL5 'Pivot', 'Read-Clipboard', 'ReadClipboardImpl', + 'Read-OleDbData', 'Remove-Worksheet', 'Select-Worksheet', 'Send-SQLDataToExcel', diff --git a/Public/Invoke-ExcelQuery.ps1 b/Public/Invoke-ExcelQuery.ps1 index 00fb4a0..f799a11 100644 --- a/Public/Invoke-ExcelQuery.ps1 +++ b/Public/Invoke-ExcelQuery.ps1 @@ -41,7 +41,7 @@ function Invoke-ExcelQuery { [String] $Query # var name consistent with Invoke-Sqlcmd ) $FullName = (Get-ChildItem $Path).FullName - Invoke-ExcelQuery ` + Read-OleDbData ` -ConnectionString "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$FullName;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'" ` -SqlStatement $Query } \ No newline at end of file diff --git a/__tests__/Read-OleDbDataTests/Read-OleDbData.Tests.ps1 b/__tests__/Read-OleDbDataTests/Read-OleDbData.Tests.ps1 index 1abb368..500772f 100644 --- a/__tests__/Read-OleDbDataTests/Read-OleDbData.Tests.ps1 +++ b/__tests__/Read-OleDbDataTests/Read-OleDbData.Tests.ps1 @@ -1,9 +1,9 @@ #Requires -Modules Pester -Import-Module $PSScriptRoot\..\..\ImportExcel.psd1 -Force $scriptPath = $PSScriptRoot +Import-Module $scriptPath\..\..\ImportExcel.psd1 -Force $tfp = "$scriptPath\Read-OleDbData.xlsx" -$cs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$tfp;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'" $ACEnotWorking = $false +$cs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$tfp;Extended Properties='Excel 12.0 Xml;HDR=NO;IMEX=1;'" try { $Results = Read-OleDbData -ConnectionString $cs -SqlStatement "select 1" }