Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from natescherer/master
Browse files Browse the repository at this point in the history
Fix misspelling of "suppress" as "supress"
  • Loading branch information
PrzemyslawKlys authored Jul 31, 2020
2 parents ad99b51 + 2b57957 commit 20c5fa8
Show file tree
Hide file tree
Showing 24 changed files with 99 additions and 88 deletions.
6 changes: 3 additions & 3 deletions Docs/Add-ExcelWorkSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schema: 2.0.0

```
Add-ExcelWorkSheet [[-ExcelDocument] <ExcelPackage>] [[-WorksheetName] <String>] [[-Option] <String>]
[[-Supress] <Boolean>] [<CommonParameters>]
[[-Suppress] <Boolean>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -62,8 +62,8 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Supress
{{Fill Supress Description}}
### -Suppress
{{Fill Suppress Description}}
```yaml
Type: Boolean
Expand Down
6 changes: 3 additions & 3 deletions Docs/Add-ExcelWorkSheetCell.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schema: 2.0.0

```
Add-ExcelWorkSheetCell [[-ExcelWorksheet] <ExcelWorksheet>] [[-CellRow] <Int32>] [[-CellColumn] <Int32>]
[[-CellValue] <Object>] [[-Supress] <Boolean>] [<CommonParameters>]
[[-CellValue] <Object>] [[-Suppress] <Boolean>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -91,8 +91,8 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Supress
{{Fill Supress Description}}
### -Suppress
{{Fill Suppress Description}}
```yaml
Type: Boolean
Expand Down
6 changes: 3 additions & 3 deletions Docs/Add-ExcelWorksheetData.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Add-ExcelWorksheetData [[-ExcelDocument] <ExcelPackage>] [[-ExcelWorksheet] <Obj
[[-Option] <String>] [[-StartRow] <Int32>] [[-StartColumn] <Int32>] [-AutoFit] [-AutoFilter] [-FreezeTopRow]
[-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [[-FreezePane] <Int32[]>] [[-ExcelWorksheetName] <String>]
[-Transpose] [[-TransposeSort] <String>] [-PreScanHeaders] [[-TableStyle] <TableStyles>]
[[-TableName] <String>] [[-Supress] <Boolean>] [<CommonParameters>]
[[-TableName] <String>] [[-Suppress] <Boolean>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -245,8 +245,8 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Supress
{{Fill Supress Description}}
### -Suppress
{{Fill Suppress Description}}
```yaml
Type: Boolean
Expand Down
6 changes: 3 additions & 3 deletions Docs/Find-ExcelDocumentText.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schema: 2.0.0

```
Find-ExcelDocumentText [[-FilePath] <String>] [[-FilePathTarget] <String>] [[-Find] <String>] [-Replace]
[[-ReplaceWith] <String>] [-Regex] [-OpenWorkBook] [[-Supress] <Boolean>] [<CommonParameters>]
[[-ReplaceWith] <String>] [-Regex] [-OpenWorkBook] [[-Suppress] <Boolean>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -136,8 +136,8 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Supress
{{Fill Supress Description}}
### -Suppress
{{Fill Suppress Description}}
```yaml
Type: Boolean
Expand Down
6 changes: 3 additions & 3 deletions Docs/Get-ExcelWorkSheetCell.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schema: 2.0.0

```
Get-ExcelWorkSheetCell [[-ExcelWorksheet] <ExcelWorksheet>] [[-CellRow] <Int32>] [[-CellColumn] <Int32>]
[[-Supress] <Boolean>] [<CommonParameters>]
[[-Suppress] <Boolean>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -76,8 +76,8 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -Supress
{{Fill Supress Description}}
### -Suppress
{{Fill Suppress Description}}
```yaml
Type: Boolean
Expand Down
4 changes: 2 additions & 2 deletions Docs/Set-ExcelProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ $FilePath = "$Env:USERPROFILE\Desktop\PSWriteExcel-Example-SetProperties.xlsx"
$Excel = New-ExcelDocument -Verbose
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace'
$myitems0 = @(
[pscustomobject]@{name = "Joe"; age = 32; info = "Cat lover"},
[pscustomobject]@{name = "Sue"; age = 29; info = "Dog lover"},
[pscustomobject]@{name = "Jason another one"; age = 42; info = "Food lover"
}
)
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True
Set-ExcelProperties -ExcelDocument $Excel -Author 'Przemyslaw Klys' -Title 'This is a test'
Set-ExcelProperties -ExcelDocument $Excel -Comments 'Testing PSWriteExcel' -Subject 'Subject'
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example.01.AddFormula.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$FilePath = "$Env:USERPROFILE\Desktop\PSWriteExcel-Example-Test.xlsx"

$Excel = New-ExcelDocument -Verbose
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Suppress $False -Option 'Replace'

Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 5 -CellValue 5
Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 2 -CellColumn 5 -CellValue 5
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example.02.AddFormulaRecalulate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$FilePath = "$PSScriptRoot\Output\PSWriteExcel.FormulaTest.xlsx"

$Excel = New-ExcelDocument -Verbose
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Suppress $False -Option 'Replace'

Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 5 -CellValue 5
Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 2 -CellColumn 5 -CellValue 5
Expand Down
2 changes: 1 addition & 1 deletion Examples/Example.04.AddFormula.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$FilePath = "$PSScriptRoot\Output\PSWriteExcel.FormulaTest7.xlsx"

$Excel = New-ExcelDocument -Verbose
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Suppress $False -Option 'Replace'

#Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 5 -CellValue 5
#Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 2 -CellColumn 5 -CellValue 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Import-Module $PSScriptRoot\..\PSWriteExcel.psd1 -Force

$FilePath = "$PSScriptRoot\Output\PSWriteExcel-Example-TestingMaximumCellLength.xlsx"
$Excel = New-ExcelDocument -Verbose
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace'
$Value = ([string]3276999).PadRight(32767999, '0')
Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 1 -CellValue $Value
Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePath -OpenWorkBook
24 changes: 12 additions & 12 deletions Examples/Run-Example-CreateExcel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ $FilePath = "$Env:USERPROFILE\Desktop\PSWriteExcel-Example-Test.xlsx"

$Excel = New-ExcelDocument -Verbose

$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Supress $False -Option 'Replace'
$ExcelWorkSheet2 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Supress $False -Option 'Replace'
$ExcelWorkSheet3 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'This is very long title - Will be cut off at some point' -Supress $false -Option 'Replace'
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Supress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Option 'Skip' -Supress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Supress $True
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Suppress $False -Option 'Replace'
$ExcelWorkSheet2 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Suppress $False -Option 'Replace'
$ExcelWorkSheet3 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'This is very long title - Will be cut off at some point' -Suppress $false -Option 'Replace'
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Suppress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Option 'Skip' -Suppress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Suppress $True
#Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 1 -CellValue 'Test'

$myitems0 = @(
Expand All @@ -20,12 +20,12 @@ $myitems0 = @(
}
)

Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet2 -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True -PreScanHeaders -TabColor ChartreuseYellow
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet3 -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True -TabColor DarkPurple
Add-ExcelWorksheetData -DataTable $myitems0 -Verbose -AutoFit -AutoFilter -Supress $True -TabColor Bisque -ExcelDocument $Excel
Add-ExcelWorksheetData -DataTable $myitems0 -AutoFit -AutoFilter -ExcelDocument $Excel -Supress $True -TabColor Grey
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet2 -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True -PreScanHeaders -TabColor ChartreuseYellow
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet3 -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True -TabColor DarkPurple
Add-ExcelWorksheetData -DataTable $myitems0 -Verbose -AutoFit -AutoFilter -Suppress $True -TabColor Bisque -ExcelDocument $Excel
Add-ExcelWorksheetData -DataTable $myitems0 -AutoFit -AutoFilter -ExcelDocument $Excel -Suppress $True -TabColor Grey

$myitems0 | Add-ExcelWorksheetData -AutoFit -AutoFilter -ExcelDocument $Excel -ExcelWorksheetName 'Hello Motto' -Supress $True -FreezeTopRow -FreezeFirstColumn -Verbose
$myitems0 | Add-ExcelWorksheetData -AutoFit -AutoFilter -ExcelDocument $Excel -ExcelWorksheetName 'Hello Motto' -Suppress $True -FreezeTopRow -FreezeFirstColumn -Verbose

Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePath -OpenWorkBook
2 changes: 1 addition & 1 deletion Examples/Run-Example-FindReplace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ $Cells1 = Find-ExcelDocumentText -FilePath $FilePath -Find 'evotec' -Replace -Re
$Cells2 = Find-ExcelDocumentText -FilePath $FilePath -Find 'evotec' -Replace -ReplaceWith 'somethingelse' -FilePathTarget $FilePathOutput2 -OpenWorkBook:$false -Regex

# Do not display found cells, replace evotec with somethingelse but don't check for case sensitivity. It will replace evotec, Evotec. Finally save it to file and open workbook.
Find-ExcelDocumentText -FilePath $FilePath -Find 'evotec' -Replace -ReplaceWith 'somethingelse' -FilePathTarget $FilePathOutput2 -OpenWorkBook -Regex -Supress $true
Find-ExcelDocumentText -FilePath $FilePath -Find 'evotec' -Replace -ReplaceWith 'somethingelse' -FilePathTarget $FilePathOutput2 -OpenWorkBook -Regex -Suppress $true
4 changes: 2 additions & 2 deletions Examples/Run-SetExcelWorkSheetCell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ $FilePath = "$Env:USERPROFILE\Desktop\PSWriteExcel-Example-SetExcelWorkSheetCell

$Excel = New-ExcelDocument -Verbose

$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace'

$myitems0 = @(
[pscustomobject]@{name = "Joe"; age = 32; info = "Cat lover"},
[pscustomobject]@{name = "Sue"; age = 29; info = "Dog lover"},
[pscustomobject]@{name = "Jason another one"; age = 42; info = "Food lover"
}
)
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True

Set-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 2 -FontName 'Arial' -FontSize 15 -FontBold $true

Expand Down
4 changes: 2 additions & 2 deletions Examples/Run-SetProperties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ $FilePath = "$Env:USERPROFILE\Desktop\PSWriteExcel-Example-SetProperties.xlsx"

$Excel = New-ExcelDocument -Verbose

$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace'
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace'

$myitems0 = @(
[pscustomobject]@{name = "Joe"; age = 32; info = "Cat lover"},
[pscustomobject]@{name = "Sue"; age = 29; info = "Dog lover"},
[pscustomobject]@{name = "Jason another one"; age = 42; info = "Food lover"
}
)
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True

Set-ExcelProperties -ExcelDocument $Excel -Author 'Przemyslaw Klys' -Title 'This is a test'
Set-ExcelProperties -ExcelDocument $Excel -Comments 'Testing PSWriteExcel' -Subject 'Subject'
Expand Down
44 changes: 22 additions & 22 deletions Examples/SpeedTests/Run-Example-Speed.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,39 @@ $MyItems3 = @(
)

$Excel = New-ExcelDocument -Verbose
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems0 -Verbose -AutoFit -AutoFilter -Supress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems1 -Verbose -AutoFit -AutoFilter -Supress $True
#$myitems0 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Supress $True
#$myitems1 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Supress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems2 -Verbose -AutoFit -AutoFilter -Supress $True
$myitems2 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Supress $True
$myitems3 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Supress $True
'testz','tests2' | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Supress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable 'testz','tests2' -Verbose -AutoFit -AutoFilter -Supress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems2 -Verbose -AutoFit -AutoFilter -Supress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems3 -Verbose -AutoFit -AutoFilter -Supress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems0 -Verbose -AutoFit -AutoFilter -Suppress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems1 -Verbose -AutoFit -AutoFilter -Suppress $True
#$myitems0 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Suppress $True
#$myitems1 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Suppress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems2 -Verbose -AutoFit -AutoFilter -Suppress $True
$myitems2 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Suppress $True
$myitems3 | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Suppress $True
'testz','tests2' | Add-ExcelWorksheetData -ExcelDocument $Excel -Verbose -AutoFit -AutoFilter -Suppress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable 'testz','tests2' -Verbose -AutoFit -AutoFilter -Suppress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems2 -Verbose -AutoFit -AutoFilter -Suppress $True
#Add-ExcelWorksheetData -ExcelDocument $Excel -DataTable $myitems3 -Verbose -AutoFit -AutoFilter -Suppress $True
Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePath -OpenWorkBook
<#
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Supress $False -Option 'Replace'
$ExcelWorkSheet2 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Supress $False -Option 'Replace'
$ExcelWorkSheet3 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'This is very long title - Will be cut off at some point' -Supress $false -Option 'Replace'
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Supress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Option 'Skip' -Supress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Supress $True
$ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 10' -Suppress $False -Option 'Replace'
$ExcelWorkSheet2 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Suppress $False -Option 'Replace'
$ExcelWorkSheet3 = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'This is very long title - Will be cut off at some point' -Suppress $false -Option 'Replace'
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Suppress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 2' -Option 'Skip' -Suppress $True
Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Option 'Replace' -Suppress $True
#Add-ExcelWorkSheetCell -ExcelWorksheet $ExcelWorkSheet -CellRow 1 -CellColumn 1 -CellValue 'Test'
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet2 -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet3 -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet2 -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True
Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet3 -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True
#>



#Add-ExcelWorksheetData -DataTable $myitems0 -AutoFit -AutoFilter -ExcelDocument $Excel -Supress $True
#Add-ExcelWorksheetData -DataTable $myitems0 -AutoFit -AutoFilter -ExcelDocument $Excel -Suppress $True

#$myitems0 | Add-ExcelWorksheetData -AutoFit -AutoFilter -ExcelDocument $Excel -ExcelWorksheetName 'Hello Motto' -Supress $True -FreezeTopRow -FreezeFirstColumn -Verbose
#$myitems0 | Add-ExcelWorksheetData -AutoFit -AutoFilter -ExcelDocument $Excel -ExcelWorksheetName 'Hello Motto' -Suppress $True -FreezeTopRow -FreezeFirstColumn -Verbose



Expand Down
2 changes: 1 addition & 1 deletion Examples/SpeedTests/Run-Example-Speed1.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Measure-Collection -Name 'ConvertTo-Excel' -ScriptBlock {
$FilePath = "$PSScriptRoot\PSWriteExcel-Example-Test.xlsx"
Measure-Collection -Name 'Add-ExcelWorkSheet' -ScriptBlock {
$Excel = New-ExcelDocument -Verbose
Add-ExcelWorksheetData -ExcelDocument $Excel -Supress $True -DataTable $Process -ExcelWorksheetName 'Test' -Verbose
Add-ExcelWorksheetData -ExcelDocument $Excel -Suppress $True -DataTable $Process -ExcelWorksheetName 'Test' -Verbose
Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePath #-OpenWorkBook
}
8 changes: 4 additions & 4 deletions Public/Add-ExcelWorkSheet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function Add-ExcelWorkSheet {
[OfficeOpenXml.ExcelPackage] $ExcelDocument,
[alias('Name')][string] $WorksheetName,
[ValidateSet("Replace", "Skip", "Rename")][string] $Option = 'Skip',
[bool] $Supress
[alias('Supress')][bool] $Suppress
)
$WorksheetName = $WorksheetName.Trim()
if ($WorksheetName.Length -eq 0) {
Expand All @@ -25,11 +25,11 @@ function Add-ExcelWorkSheet {
} elseif ($Option -eq 'Replace') {
Write-Verbose "Add-ExcelWorkSheet - WorksheetName: '$WorksheetName' - exists. Replacing worksheet with empty worksheet."
Remove-ExcelWorksheet -ExcelDocument $ExcelDocument -ExcelWorksheet $PreviousWorksheet
$Data = Add-ExcelWorkSheet -ExcelDocument $ExcelDocument -WorksheetName $WorksheetName -Option $Option -Supress $False
$Data = Add-ExcelWorkSheet -ExcelDocument $ExcelDocument -WorksheetName $WorksheetName -Option $Option -Suppress $False
} elseif ($Option -eq 'Rename') {
Write-Verbose "Add-ExcelWorkSheet - Worksheet: '$WorksheetName' already exists. Renaming worksheet to random value."
$WorksheetName = Get-RandomStringName -Size 31
$Data = Add-ExcelWorkSheet -ExcelDocument $ExcelDocument -WorksheetName $WorksheetName -Option $Option -Supress $False
$Data = Add-ExcelWorkSheet -ExcelDocument $ExcelDocument -WorksheetName $WorksheetName -Option $Option -Suppress $False
Write-Verbose "Add-ExcelWorkSheet - New worksheet name $WorksheetName"
} else {
#Write-Verbose "Future use..."
Expand All @@ -46,5 +46,5 @@ function Add-ExcelWorkSheet {
#Write-Warning "Add-ExcelWorkSheet - Maximum amount of chars is 31 for worksheet name"
#}
}
if ($Supress) { return } else { return $data }
if ($Suppress) { return } else { return $data }
}
Loading

0 comments on commit 20c5fa8

Please sign in to comment.