Skip to content

Commit

Permalink
Remove Table ParameterSets
Browse files Browse the repository at this point in the history
  • Loading branch information
ili101 committed Apr 14, 2019
1 parent 694b847 commit a404a4a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Export-Excel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,8 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "")]
Param(
[Parameter(Mandatory = $true, ParameterSetName = "Path", Position = 0, ValueFromPipelineByPropertyName)]
[Parameter(Mandatory = $true, ParameterSetName = "Path-Table" , Position = 0, ValueFromPipelineByPropertyName)]
[String]$Path,
[Parameter(Mandatory = $true, ParameterSetName = "Package", ValueFromPipelineByPropertyName)]
[Parameter(Mandatory = $true, ParameterSetName = "Package-Table", ValueFromPipelineByPropertyName)]
[OfficeOpenXml.ExcelPackage]$ExcelPackage,
[Parameter(ValueFromPipeline = $true)]
[Alias('TargetData')]
Expand Down Expand Up @@ -462,9 +460,6 @@
[Switch]$FreezeFirstColumn,
[Switch]$FreezeTopRowFirstColumn,
[Int[]]$FreezePane,
[Parameter(ParameterSetName = 'Path')]
[Parameter(ParameterSetName = 'Package')]
[Parameter(ParameterSetName = 'Now')]
[Switch]$AutoFilter,
[Switch]$BoldTopRow,
[Switch]$NoHeader,
Expand All @@ -479,13 +474,7 @@
elseif ($_[0] -notmatch '[a-z]') { throw 'Tablename starts with an invalid character.' }
else { $true }
})]
[Parameter(ParameterSetName = 'Path-Table' , Mandatory = $true, ValueFromPipelineByPropertyName)]
[Parameter(ParameterSetName = 'Package-Table' , Mandatory = $true, ValueFromPipelineByPropertyName)]
[Parameter(ParameterSetName = 'Now-Table' , Mandatory = $true, ValueFromPipelineByPropertyName)]
[String]$TableName,
[Parameter(ParameterSetName = 'Path-Table')]
[Parameter(ParameterSetName = 'Package-Table')]
[Parameter(ParameterSetName = 'Now-Table')]
[OfficeOpenXml.Table.TableStyles]$TableStyle,
[Switch]$Barchart,
[Switch]$PieChart,
Expand Down Expand Up @@ -513,7 +502,6 @@
[ScriptBlock]$CellStyleSB,
#If there is already content in the workbook the sheet with the PivotTable will not be active UNLESS Activate is specified
[switch]$Activate,
[Parameter(ParameterSetName = 'Now-Table')]
[Parameter(ParameterSetName = 'Now')]
[Switch]$Now,
[Switch]$ReturnRange,
Expand All @@ -533,6 +521,7 @@
try {
$script:Header = $null
if ($Append -and $ClearSheet) {throw "You can't use -Append AND -ClearSheet."}
if ($TableName -or $TableStyle) {$AutoFilter = $false}
if ($PSBoundParameters.Keys.Count -eq 0 -Or $Now -or (-not $Path -and -not $ExcelPackage) ) {
$Path = [System.IO.Path]::GetTempFileName() -replace '\.tmp', '.xlsx'
if (-not $PSBoundParameters.ContainsKey("Show")) {$Show = $true}
Expand Down

0 comments on commit a404a4a

Please sign in to comment.