mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
updated
This commit is contained in:
@@ -14,7 +14,7 @@ function Export-Excel {
|
||||
Get-Service | Export-Excel "c:\temp\test.xlsx" -Show -IncludePivotTable -PivotRows status -PivotData @{status='count'}
|
||||
#>
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
#[Parameter(Mandatory=$true)]
|
||||
$Path,
|
||||
[Parameter(ValueFromPipeline=$true)]
|
||||
$TargetData,
|
||||
@@ -51,7 +51,6 @@ function Export-Excel {
|
||||
[Object[]]$ConditionalFormat,
|
||||
[Object[]]$ConditionalText,
|
||||
[Object[]]$ExcelChartDefinition,
|
||||
# [Object[]]$CellStyle,
|
||||
[ScriptBlock]$CellStyleSB,
|
||||
[string[]]$HideSheet,
|
||||
[Switch]$KillExcel,
|
||||
@@ -59,7 +58,8 @@ function Export-Excel {
|
||||
$StartRow=1,
|
||||
$StartColumn=1,
|
||||
[Switch]$PassThru,
|
||||
[string]$Numberformat="General"
|
||||
[string]$Numberformat="General",
|
||||
[Switch]$Now
|
||||
)
|
||||
|
||||
Begin {
|
||||
@@ -70,7 +70,15 @@ function Export-Excel {
|
||||
}
|
||||
|
||||
try {
|
||||
if($Now) {
|
||||
$Path=[System.IO.Path]::GetTempFileName() -replace "\.tmp",".xlsx"
|
||||
$Show=$true
|
||||
$AutoSize=$true
|
||||
$AutoFilter=$true
|
||||
}
|
||||
|
||||
$Path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path)
|
||||
|
||||
if (Test-Path $path) {
|
||||
Write-Debug "File `"$Path`" already exists"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user