Add helper method

This commit is contained in:
Roy Ashbrook
2021-11-03 10:35:22 -04:00
parent 91a1240408
commit 5e7b404daf
4 changed files with 70 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
#Requires -Modules Pester
$scriptPath = $PSScriptRoot
Import-Module $scriptPath\..\..\ImportExcel.psd1 -Force
$tfp = "$scriptPath\Read-OleDbData.xlsx"
$ACEnotWorking = $false
try {
$Results = Read-XlsxUsingOleDb $tfp "select 1"
}
catch {
$ACEnotWorking = $true
}
Describe "Read-XlsxUsingOleDb" -Tag "Read-XlsxUsingOleDb" {
$PSDefaultParameterValues = @{ 'It:Skip' = $ACEnotWorking }
Context "Sheet1`$A1" {
It "Should return 1 result with a value of 1" {
$Results = Read-XlsxUsingOleDb $tfp "select ROUND(F1) as [A1] from [sheet1`$A1:A1]"
@($Results).length + $Results.A1 | Should -Be 2
}
}
}