From 73b8de7793598fa0b5e576ed9440cc2ed95914ff Mon Sep 17 00:00:00 2001 From: Nate Scherer <376408+natescherer@users.noreply.github.com> Date: Fri, 31 Jul 2020 09:22:14 -0400 Subject: [PATCH 1/4] Fix spelling of 'suppress' in docs and examples --- Docs/Add-ExcelWorkSheet.md | 6 +-- Docs/Add-ExcelWorkSheetCell.md | 6 +-- Docs/Add-ExcelWorksheetData.md | 6 +-- Docs/Find-ExcelDocumentText.md | 6 +-- Docs/Get-ExcelWorkSheetCell.md | 6 +-- Docs/Set-ExcelProperties.md | 4 +- Examples/Example.01.AddFormula.ps1 | 2 +- Examples/Example.02.AddFormulaRecalulate.ps1 | 2 +- Examples/Example.04.AddFormula.ps1 | 2 +- ...> Example.05.TestingMaximumCellLength.ps1} | 2 +- Examples/Run-Example-CreateExcel.ps1 | 24 +++++----- Examples/Run-Example-FindReplace.ps1 | 2 +- Examples/Run-SetExcelWorkSheetCell.ps1 | 4 +- Examples/Run-SetProperties.ps1 | 4 +- Examples/SpeedTests/Run-Example-Speed.ps1 | 44 +++++++++---------- Examples/SpeedTests/Run-Example-Speed1.ps1 | 2 +- 16 files changed, 61 insertions(+), 61 deletions(-) rename Examples/{Example.05.TestingMaximumCellLengthps1 => Example.05.TestingMaximumCellLength.ps1} (89%) diff --git a/Docs/Add-ExcelWorkSheet.md b/Docs/Add-ExcelWorkSheet.md index 0283330..ecb00da 100644 --- a/Docs/Add-ExcelWorkSheet.md +++ b/Docs/Add-ExcelWorkSheet.md @@ -14,7 +14,7 @@ schema: 2.0.0 ``` Add-ExcelWorkSheet [[-ExcelDocument] ] [[-WorksheetName] ] [[-Option] ] - [[-Supress] ] [] + [[-Suppress] ] [] ``` ## DESCRIPTION @@ -62,8 +62,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Supress -{{Fill Supress Description}} +### -Suppress +{{Fill Suppress Description}} ```yaml Type: Boolean diff --git a/Docs/Add-ExcelWorkSheetCell.md b/Docs/Add-ExcelWorkSheetCell.md index 5c95863..87c7613 100644 --- a/Docs/Add-ExcelWorkSheetCell.md +++ b/Docs/Add-ExcelWorkSheetCell.md @@ -14,7 +14,7 @@ schema: 2.0.0 ``` Add-ExcelWorkSheetCell [[-ExcelWorksheet] ] [[-CellRow] ] [[-CellColumn] ] - [[-CellValue] ] [[-Supress] ] [] + [[-CellValue] ] [[-Suppress] ] [] ``` ## DESCRIPTION @@ -91,8 +91,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Supress -{{Fill Supress Description}} +### -Suppress +{{Fill Suppress Description}} ```yaml Type: Boolean diff --git a/Docs/Add-ExcelWorksheetData.md b/Docs/Add-ExcelWorksheetData.md index f16eaf9..67af858 100644 --- a/Docs/Add-ExcelWorksheetData.md +++ b/Docs/Add-ExcelWorksheetData.md @@ -17,7 +17,7 @@ Add-ExcelWorksheetData [[-ExcelDocument] ] [[-ExcelWorksheet] ] [[-StartRow] ] [[-StartColumn] ] [-AutoFit] [-AutoFilter] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [[-FreezePane] ] [[-ExcelWorksheetName] ] [-Transpose] [[-TransposeSort] ] [-PreScanHeaders] [[-TableStyle] ] - [[-TableName] ] [[-Supress] ] [] + [[-TableName] ] [[-Suppress] ] [] ``` ## DESCRIPTION @@ -245,8 +245,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Supress -{{Fill Supress Description}} +### -Suppress +{{Fill Suppress Description}} ```yaml Type: Boolean diff --git a/Docs/Find-ExcelDocumentText.md b/Docs/Find-ExcelDocumentText.md index 20fa25f..4573535 100644 --- a/Docs/Find-ExcelDocumentText.md +++ b/Docs/Find-ExcelDocumentText.md @@ -14,7 +14,7 @@ schema: 2.0.0 ``` Find-ExcelDocumentText [[-FilePath] ] [[-FilePathTarget] ] [[-Find] ] [-Replace] - [[-ReplaceWith] ] [-Regex] [-OpenWorkBook] [[-Supress] ] [] + [[-ReplaceWith] ] [-Regex] [-OpenWorkBook] [[-Suppress] ] [] ``` ## DESCRIPTION @@ -136,8 +136,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Supress -{{Fill Supress Description}} +### -Suppress +{{Fill Suppress Description}} ```yaml Type: Boolean diff --git a/Docs/Get-ExcelWorkSheetCell.md b/Docs/Get-ExcelWorkSheetCell.md index 75117c6..1f336f0 100644 --- a/Docs/Get-ExcelWorkSheetCell.md +++ b/Docs/Get-ExcelWorkSheetCell.md @@ -14,7 +14,7 @@ schema: 2.0.0 ``` Get-ExcelWorkSheetCell [[-ExcelWorksheet] ] [[-CellRow] ] [[-CellColumn] ] - [[-Supress] ] [] + [[-Suppress] ] [] ``` ## DESCRIPTION @@ -76,8 +76,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Supress -{{Fill Supress Description}} +### -Suppress +{{Fill Suppress Description}} ```yaml Type: Boolean diff --git a/Docs/Set-ExcelProperties.md b/Docs/Set-ExcelProperties.md index c066570..42f7a15 100644 --- a/Docs/Set-ExcelProperties.md +++ b/Docs/Set-ExcelProperties.md @@ -34,7 +34,7 @@ $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"}, @@ -42,7 +42,7 @@ $myitems0 = @( [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' diff --git a/Examples/Example.01.AddFormula.ps1 b/Examples/Example.01.AddFormula.ps1 index b499834..be5577e 100644 --- a/Examples/Example.01.AddFormula.ps1 +++ b/Examples/Example.01.AddFormula.ps1 @@ -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 diff --git a/Examples/Example.02.AddFormulaRecalulate.ps1 b/Examples/Example.02.AddFormulaRecalulate.ps1 index faae79c..72b7f16 100644 --- a/Examples/Example.02.AddFormulaRecalulate.ps1 +++ b/Examples/Example.02.AddFormulaRecalulate.ps1 @@ -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 diff --git a/Examples/Example.04.AddFormula.ps1 b/Examples/Example.04.AddFormula.ps1 index 78ebcc3..83773ea 100644 --- a/Examples/Example.04.AddFormula.ps1 +++ b/Examples/Example.04.AddFormula.ps1 @@ -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 diff --git a/Examples/Example.05.TestingMaximumCellLengthps1 b/Examples/Example.05.TestingMaximumCellLength.ps1 similarity index 89% rename from Examples/Example.05.TestingMaximumCellLengthps1 rename to Examples/Example.05.TestingMaximumCellLength.ps1 index 7ef0465..1446810 100644 --- a/Examples/Example.05.TestingMaximumCellLengthps1 +++ b/Examples/Example.05.TestingMaximumCellLength.ps1 @@ -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 diff --git a/Examples/Run-Example-CreateExcel.ps1 b/Examples/Run-Example-CreateExcel.ps1 index 5ccbb83..c44130f 100644 --- a/Examples/Run-Example-CreateExcel.ps1 +++ b/Examples/Run-Example-CreateExcel.ps1 @@ -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 = @( @@ -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 \ No newline at end of file diff --git a/Examples/Run-Example-FindReplace.ps1 b/Examples/Run-Example-FindReplace.ps1 index 284f37e..a2bf556 100644 --- a/Examples/Run-Example-FindReplace.ps1 +++ b/Examples/Run-Example-FindReplace.ps1 @@ -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 \ No newline at end of file +Find-ExcelDocumentText -FilePath $FilePath -Find 'evotec' -Replace -ReplaceWith 'somethingelse' -FilePathTarget $FilePathOutput2 -OpenWorkBook -Regex -Suppress $true \ No newline at end of file diff --git a/Examples/Run-SetExcelWorkSheetCell.ps1 b/Examples/Run-SetExcelWorkSheetCell.ps1 index fce4edc..401fa7f 100644 --- a/Examples/Run-SetExcelWorkSheetCell.ps1 +++ b/Examples/Run-SetExcelWorkSheetCell.ps1 @@ -4,7 +4,7 @@ $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"}, @@ -12,7 +12,7 @@ $myitems0 = @( [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 diff --git a/Examples/Run-SetProperties.ps1 b/Examples/Run-SetProperties.ps1 index 7a6e05a..b39b494 100644 --- a/Examples/Run-SetProperties.ps1 +++ b/Examples/Run-SetProperties.ps1 @@ -4,7 +4,7 @@ $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"}, @@ -12,7 +12,7 @@ $myitems0 = @( [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' diff --git a/Examples/SpeedTests/Run-Example-Speed.ps1 b/Examples/SpeedTests/Run-Example-Speed.ps1 index 97007db..1015ea0 100644 --- a/Examples/SpeedTests/Run-Example-Speed.ps1 +++ b/Examples/SpeedTests/Run-Example-Speed.ps1 @@ -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 diff --git a/Examples/SpeedTests/Run-Example-Speed1.ps1 b/Examples/SpeedTests/Run-Example-Speed1.ps1 index b0ebebb..717ccc8 100644 --- a/Examples/SpeedTests/Run-Example-Speed1.ps1 +++ b/Examples/SpeedTests/Run-Example-Speed1.ps1 @@ -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 } \ No newline at end of file From 7c35503f3d002c69f4827ffb2709baf89839279e Mon Sep 17 00:00:00 2001 From: Nate Scherer <376408+natescherer@users.noreply.github.com> Date: Fri, 31 Jul 2020 09:22:50 -0400 Subject: [PATCH 2/4] Fix spelling of 'suppress' in tests --- Tests/Get-ExcelProperties.Tests.ps1 | 16 ++++++++-------- Tests/Set-ExcelProperties.Tests.ps1 | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Tests/Get-ExcelProperties.Tests.ps1 b/Tests/Get-ExcelProperties.Tests.ps1 index 8540e81..8e2c625 100644 --- a/Tests/Get-ExcelProperties.Tests.ps1 +++ b/Tests/Get-ExcelProperties.Tests.ps1 @@ -18,8 +18,8 @@ $PSDefaultParameterValues = @{ Describe 'Get-ExcelProperties - Getting Excel Properties' { It 'Using Get-ExcelProperties - Getting Author, Title and Subject Properties should be readable' { $Excel = New-ExcelDocument - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Author 'Przemyslaw Klys' -Title 'PSWriteExcel Set-Properties' -Subject 'PSWriteExcel' $Properties = Get-ExcelProperties -ExcelDocument $Excel @@ -32,8 +32,8 @@ Describe 'Get-ExcelProperties - Getting Excel Properties' { [DateTime] $Modified = Get-Date -Year '2018' -Month '09' -Day '27' -Hour 0 -Minute 0 -Second 0 -Millisecond 0 $Excel = New-ExcelDocument - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Created $Created -Modified $Modified -Category 'Excel' $Properties = Get-ExcelProperties -ExcelDocument $Excel @@ -46,8 +46,8 @@ Describe 'Get-ExcelProperties - Getting Excel Properties' { [DateTime] $Modified = Get-Date -Year '2018' -Month '09' -Day '27' -Hour 0 -Minute 0 -Second 0 -Millisecond 0 $Excel = New-ExcelDocument - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Application 'Test 1' -AppVersion 'Test 2' -Keywords 'My key word' -LastModifiedBy 'Przemyslaw Klys' -LastPrinted 'Evotec' -LinksUpToDate $false -Manager 'Przemyslaw Klys' -ScaleCrop $true -SharedDoc $false -Status 'My status' $Properties = Get-ExcelProperties -ExcelDocument $Excel @@ -69,8 +69,8 @@ Describe 'Get-ExcelProperties - Getting Excel Properties' { $FilePath = [IO.Path]::Combine($TemporaryFolder, "Get-ExpelProperties-Test.xlsx") $Excel = New-ExcelDocument - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Application 'Test 1' -AppVersion 'Test 2' -Keywords 'My key word' -LastModifiedBy 'Przemyslaw Klys' -LastPrinted 'Evotec' -LinksUpToDate $false -Manager 'Przemyslaw Klys' -ScaleCrop $true -SharedDoc $false -Status 'My status' Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePath diff --git a/Tests/Set-ExcelProperties.Tests.ps1 b/Tests/Set-ExcelProperties.Tests.ps1 index e2919c6..1fe0610 100644 --- a/Tests/Set-ExcelProperties.Tests.ps1 +++ b/Tests/Set-ExcelProperties.Tests.ps1 @@ -24,8 +24,8 @@ $PSDefaultParameterValues = @{ Describe 'Set-ExcelProperties - Setting Excel Properties' { It 'Using Set-ExcelProperties - Setting Author, Title and Subject Properties should work' { $Excel = New-ExcelDocument -Verbose - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Author 'Przemyslaw Klys' -Title 'PSWriteExcel Set-Properties' -Subject 'PSWriteExcel' $Excel.Workbook.Properties.Author | Should -Be 'Przemyslaw Klys' @@ -37,8 +37,8 @@ Describe 'Set-ExcelProperties - Setting Excel Properties' { [DateTime] $Modified = Get-Date -Year '2018' -Month '09' -Day '27' -Hour 0 -Minute 0 -Second 0 -Millisecond 0 $Excel = New-ExcelDocument -Verbose - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Created $Created -Modified $Modified -Category 'Excel' $Excel.Workbook.Properties.Created | Should -Be $Created @@ -50,8 +50,8 @@ Describe 'Set-ExcelProperties - Setting Excel Properties' { [DateTime] $Modified = Get-Date -Year '2018' -Month '09' -Day '27' -Hour 0 -Minute 0 -Second 0 -Millisecond 0 $Excel = New-ExcelDocument -Verbose - $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' - Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Suppress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Suppress $True Set-ExcelProperties -ExcelDocument $Excel -Application 'Test 1' -AppVersion 'Test 2' -Keywords 'My key word' -LastModifiedBy 'Przemyslaw Klys' -LastPrinted 'Evotec' -LinksUpToDate $false -Manager 'Przemyslaw Klys' -ScaleCrop $true -SharedDoc $false -Status 'My status' $Excel.Workbook.Properties.Application | Should -Be 'Test 1' From 78a93a43989cb9606944b379110e8b78823c0637 Mon Sep 17 00:00:00 2001 From: Nate Scherer <376408+natescherer@users.noreply.github.com> Date: Fri, 31 Jul 2020 09:31:55 -0400 Subject: [PATCH 3/4] Add test for "supress" parameter alias --- Tests/Get-ExcelProperties.Tests.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/Get-ExcelProperties.Tests.ps1 b/Tests/Get-ExcelProperties.Tests.ps1 index 8e2c625..bb14170 100644 --- a/Tests/Get-ExcelProperties.Tests.ps1 +++ b/Tests/Get-ExcelProperties.Tests.ps1 @@ -89,4 +89,15 @@ Describe 'Get-ExcelProperties - Getting Excel Properties' { Remove-Item -Path $FilePath -Confirm:$false -ErrorAction SilentlyContinue } + It 'Using Get-ExcelProperties - Previous "Supress" parameter should still work on Add-ExcelWorkSheet and Add-ExcelWorkSheetData' { + $Excel = New-ExcelDocument + $ExcelWorkSheet = Add-ExcelWorkSheet -ExcelDocument $Excel -WorksheetName 'Test 1' -Supress $False -Option 'Replace' + Add-ExcelWorksheetData -ExcelWorksheet $ExcelWorkSheet -DataTable $myitems0 -AutoFit -AutoFilter -Supress $True + Set-ExcelProperties -ExcelDocument $Excel -Author 'Przemyslaw Klys' -Title 'PSWriteExcel Set-Properties' -Subject 'PSWriteExcel' + + $Properties = Get-ExcelProperties -ExcelDocument $Excel + $Properties.Author | Should -Be 'Przemyslaw Klys' + $Properties.Title | Should -Be 'PSWriteExcel Set-Properties' + $Properties.Subject | Should -Be 'PSWriteExcel' + } } \ No newline at end of file From 2b57957a299933cb8c7aee2e5e5e40e680bb3110 Mon Sep 17 00:00:00 2001 From: Nate Scherer <376408+natescherer@users.noreply.github.com> Date: Fri, 31 Jul 2020 09:32:20 -0400 Subject: [PATCH 4/4] Update spelling of suppress in functions and add "supress" aliases --- Public/Add-ExcelWorkSheet.ps1 | 8 ++++---- Public/Add-ExcelWorkSheetData.ps1 | 4 ++-- Public/ConvertTo-Excel.ps1 | 2 +- Public/Find-ExcelDocumentText.ps1 | 4 ++-- Public/Get-ExcelWorkSheetCell.ps1 | 2 +- Public/Worksheet.ps1 | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Public/Add-ExcelWorkSheet.ps1 b/Public/Add-ExcelWorkSheet.ps1 index e24c2d0..321e7f0 100644 --- a/Public/Add-ExcelWorkSheet.ps1 +++ b/Public/Add-ExcelWorkSheet.ps1 @@ -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) { @@ -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..." @@ -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 } } diff --git a/Public/Add-ExcelWorkSheetData.ps1 b/Public/Add-ExcelWorkSheetData.ps1 index 8537ed9..3739943 100644 --- a/Public/Add-ExcelWorkSheetData.ps1 +++ b/Public/Add-ExcelWorkSheetData.ps1 @@ -20,7 +20,7 @@ function Add-ExcelWorksheetData { [alias('TableStyles')][nullable[OfficeOpenXml.Table.TableStyles]] $TableStyle, [string] $TableName, [string] $TabColor, - [bool] $Supress + [alias('Supress')][bool] $Suppress ) Begin { $FirstRun = $True @@ -183,7 +183,7 @@ function Add-ExcelWorksheetData { $ExcelWorksheet.TabColor = ConvertFrom-Color -Color $TabColor -AsDrawingColor } #Write-Verbose 'Add-ExcelWorksheetData - Ending...' - if ($Supress) { return } else { return $ExcelWorkSheet } + if ($Suppress) { return } else { return $ExcelWorkSheet } } } diff --git a/Public/ConvertTo-Excel.ps1 b/Public/ConvertTo-Excel.ps1 index 0e26651..ddcc96e 100644 --- a/Public/ConvertTo-Excel.ps1 +++ b/Public/ConvertTo-Excel.ps1 @@ -59,7 +59,7 @@ function ConvertTo-Excel { -TransposeSort $TransposeSort ` -Option $Option ` -TableStyle $TableStyle ` - -TableName $TableName -AllProperties:$AllProperties.IsPresent -Supress $true + -TableName $TableName -AllProperties:$AllProperties.IsPresent -Suppress $true Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePath -OpenWorkBook:$OpenWorkBook } } \ No newline at end of file diff --git a/Public/Find-ExcelDocumentText.ps1 b/Public/Find-ExcelDocumentText.ps1 index 351c432..659c255 100644 --- a/Public/Find-ExcelDocumentText.ps1 +++ b/Public/Find-ExcelDocumentText.ps1 @@ -8,7 +8,7 @@ function Find-ExcelDocumentText { [string] $ReplaceWith, [switch] $Regex, [switch] $OpenWorkBook, - [bool] $Supress + [alias('Supress')][bool] $Suppress ) $Excel = Get-ExcelDocument -Path $FilePath if ($Excel) { @@ -43,7 +43,7 @@ function Find-ExcelDocumentText { if ($Replace) { Save-ExcelDocument -ExcelDocument $Excel -FilePath $FilePathTarget -OpenWorkBook:$OpenWorkBook } - if ($Supress) { + if ($Suppress) { return } else { return $Addresses diff --git a/Public/Get-ExcelWorkSheetCell.ps1 b/Public/Get-ExcelWorkSheetCell.ps1 index 24b8d89..860d790 100644 --- a/Public/Get-ExcelWorkSheetCell.ps1 +++ b/Public/Get-ExcelWorkSheetCell.ps1 @@ -4,7 +4,7 @@ function Get-ExcelWorkSheetCell { [OfficeOpenXml.ExcelWorksheet] $ExcelWorksheet, [int] $CellRow, [int] $CellColumn, - [bool] $Supress + [alias('Supress')][bool] $Suppress ) if ($ExcelWorksheet) { $ExcelWorksheet.Cells[$CellRow, $CellColumn].Value diff --git a/Public/Worksheet.ps1 b/Public/Worksheet.ps1 index 1ea5c1a..9e72dde 100644 --- a/Public/Worksheet.ps1 +++ b/Public/Worksheet.ps1 @@ -15,14 +15,14 @@ [string] $Name, [ValidateSet("Replace", "Skip", "Rename")][string] $Option = 'Replace', [string] $TabColor, - [bool] $Supress, + [alias('Supress')][bool] $Suppress, [switch] $AutoFilter, [switch] $AutoFit ) $addExcelWorkSheetDataSplat = @{ DataTable = $DataTable TabColor = $TabColor - Supress = $Supress + Suppress = $Suppress Option = $Option ExcelDocument = $ExcelDocument ExcelWorksheetName = $Name @@ -34,7 +34,7 @@ $ExcelWorkSheetParameters = [ordered] @{ DataTable = $DataTable TabColor = $TabColor - Supress = $true + Suppress = $true Option = $Option ExcelDocument = $Script:Excel.ExcelDocument Name = $Name