Trying out PassThru

This commit is contained in:
dfinke
2016-02-17 20:39:07 -05:00
parent 4a6b92d122
commit b75f651eee
2 changed files with 38 additions and 4 deletions

View File

@@ -51,7 +51,8 @@ function Export-Excel {
[Switch]$KillExcel,
[Switch]$AutoNameRange,
$StartRow=1,
$StartColumn=1
$StartColumn=1,
[Switch]$PassThru
)
Begin {
@@ -360,9 +361,13 @@ function Export-Excel {
}
}
$pkg.Save()
$pkg.Dispose()
if($PassThru) {
$pkg
} else {
$pkg.Save()
$pkg.Dispose()
if($Show) {Invoke-Item $Path}
if($Show) {Invoke-Item $Path}
}
}
}