mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
use ChangeExtension for robustness
This commit is contained in:
@@ -19,7 +19,7 @@ function ConvertTo-ExcelXlsx {
|
|||||||
|
|
||||||
$xlFixedFormat = 51 #Constant for XLSX Workbook
|
$xlFixedFormat = 51 #Constant for XLSX Workbook
|
||||||
$xlsFile = Get-Item -Path $singlePath
|
$xlsFile = Get-Item -Path $singlePath
|
||||||
$xlsxPath = "{0}x" -f $xlsFile.FullName
|
$xlsxPath = [System.IO.Path]::ChangeExtension($xlsFile.FullName, ".xlsx")
|
||||||
|
|
||||||
if ($xlsFile.Extension -ne ".xls") {
|
if ($xlsFile.Extension -ne ".xls") {
|
||||||
throw "Expected .xls extension"
|
throw "Expected .xls extension"
|
||||||
|
|||||||
Reference in New Issue
Block a user