mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-23 11:43:53 +00:00
perf: removed verbose from loop in import. tests: better alias check
This commit is contained in:
@@ -394,12 +394,13 @@ function Import-Excel {
|
|||||||
else {
|
else {
|
||||||
#region Create one object per row
|
#region Create one object per row
|
||||||
foreach ($R in $Rows) {
|
foreach ($R in $Rows) {
|
||||||
Write-Verbose "Import row '$R'"
|
#Disabled write-verbose for speed
|
||||||
|
# Write-Verbose "Import row '$R'"
|
||||||
$NewRow = [Ordered]@{}
|
$NewRow = [Ordered]@{}
|
||||||
|
|
||||||
foreach ($P in $PropertyNames) {
|
foreach ($P in $PropertyNames) {
|
||||||
$NewRow[$P.Value] = $Worksheet.Cells[$R, $P.Column].Value
|
$NewRow[$P.Value] = $Worksheet.Cells[$R, $P.Column].Value
|
||||||
Write-Verbose "Import cell '$($Worksheet.Cells[$R, $P.Column].Address)' with property name '$($p.Value)' and value '$($Worksheet.Cells[$R, $P.Column].Value)'."
|
# Write-Verbose "Import cell '$($Worksheet.Cells[$R, $P.Column].Address)' with property name '$($p.Value)' and value '$($Worksheet.Cells[$R, $P.Column].Value)'."
|
||||||
}
|
}
|
||||||
|
|
||||||
[PSCustomObject]$NewRow
|
[PSCustomObject]$NewRow
|
||||||
|
|||||||
@@ -1,26 +1,28 @@
|
|||||||
#Requires -Modules Pester
|
#Requires -Modules Pester
|
||||||
|
remove-module importExcel -erroraction silentlyContinue
|
||||||
Import-Module $PSScriptRoot\..\ImportExcel.psd1 -Force
|
Import-Module $PSScriptRoot\..\ImportExcel.psd1 -Force
|
||||||
|
|
||||||
|
|
||||||
Describe "Check if Function aliases exist" {
|
Describe "Check if Function aliases exist" {
|
||||||
|
|
||||||
It "Set-Column should exist" {
|
It "Set-Column should exist" {
|
||||||
Get-Command Set-Column | Should Not Be $null
|
${Alias:Set-Column} | Should Not BeNullOrEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Set-Row should exist" {
|
It "Set-Row should exist" {
|
||||||
Get-Command Set-Row | Should Not Be $null
|
${Alias:Set-Row} | Should Not BeNullOrEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Set-Format should exist" {
|
It "Set-Format should exist" {
|
||||||
Get-Command Set-Format | Should Not Be $null
|
${Alias:Set-Format} | Should Not BeNullOrEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Merge-MulipleSheets should exist" {
|
<#It "Merge-MulipleSheets should exist" {
|
||||||
Get-Command Merge-MulipleSheets | Should Not Be $null
|
Get-Command Merge-MulipleSheets | Should Not Be $null
|
||||||
}
|
}
|
||||||
|
#>
|
||||||
It "New-ExcelChart should exist" {
|
It "New-ExcelChart should exist" {
|
||||||
Get-Command New-ExcelChart | Should Not Be $null
|
${Alias:New-ExcelChart} | Should Not BeNullOrEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user