Use value instead of Text when reading cells to preserve types.

This commit is contained in:
Staffan Gustafsson
2015-09-08 14:26:33 +02:00
committed by dfinke
parent 84e273387c
commit 5f5ba10021

View File

@@ -36,7 +36,7 @@ function Import-Excel {
foreach ($Column in 0..($Columns-1)) {
if($Header[$Column].Length -gt 0) {
$Name = $Header[$Column]
$h.$Name = $worksheet.Cells[$Row,($Column+1)].Text
$h.$Name = $worksheet.Cells[$Row,($Column+1)].Value
}
}
[PSCustomObject]$h