Fixes Casting Error in Export-Excel #108

This commit is contained in:
dfinke
2016-06-28 15:01:41 -04:00
parent 1788e6bbe8
commit 3c5020f137
3 changed files with 67 additions and 66 deletions

View File

@@ -135,7 +135,7 @@ function Export-Excel {
$r=$null
$cellValue=$TargetData
if([Double]::TryParse($cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
if([Double]::TryParse([string]$cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
$targetCell.Value = $r
$targetCell.Style.Numberformat.Format=$Numberformat
} else {
@@ -181,7 +181,7 @@ function Export-Excel {
} else {
$r=$null
if([Double]::TryParse($cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
if([Double]::TryParse([string]$cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
$targetCell.Value = $r
$targetCell.Style.Numberformat.Format=$Numberformat
} else {

View File

@@ -4,7 +4,7 @@
RootModule = 'ImportExcel.psm1'
# Version number of this module.
ModuleVersion = '2.2.5'
ModuleVersion = '2.2.6'
# ID used to uniquely identify this module
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'

View File

@@ -19,8 +19,6 @@ Install-Module ImportExcel -scope CurrentUser
Install-Module ImportExcel
```
####Powershell V4 and Earlier
To install to your personal modules folder (e.g. ~\Documents\WindowsPowerShell\Modules), run:
@@ -30,6 +28,9 @@ iex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/dfi
# What's new
#### 6/28/2016
* Fixed [Casting Error in Export-Excel](https://github.com/dfinke/ImportExcel/issues/108)
#### 6/01/2016
* Added -UseDefaultCredentials to both `Import-Html` and `Get-HtmlTable`
* New functions, `Import-UPS` and `Import-USPS`. Pass in a valid tracking # and it scrapes the page for the delivery details