GitBook: [master] 133 pages and 8 assets modified

This commit is contained in:
Doug Finke
2020-11-28 13:13:00 +00:00
committed by gitbook-bot
parent 70ab9e46c7
commit 7f72aa9e86
77 changed files with 2243 additions and 1484 deletions

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View File

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

943
README.md

File diff suppressed because it is too large Load Diff

74
SUMMARY.md Normal file
View File

@@ -0,0 +1,74 @@
# Table of contents
* [README](README.md)
* [InferData](inferdata/README.md)
* [Test-Boolean](inferdata/test-boolean.md)
* [Invoke-AllTests](inferdata/invoke-alltests.md)
* [Test-Integer](inferdata/test-integer.md)
* [Test-String](inferdata/test-string.md)
* [Test-Date](inferdata/test-date.md)
* [Test-Number](inferdata/test-number.md)
* [mdHelp](mdhelp/README.md)
* [en](mdhelp/en/README.md)
* [Expand-NumberFormat](mdhelp/en/expand-numberformat.md)
* [Open-ExcelPackage](mdhelp/en/open-excelpackage.md)
* [Add-ExcelChart](mdhelp/en/add-excelchart.md)
* [Copy-ExcelWorkSheet](mdhelp/en/copy-excelworksheet.md)
* [Set-ExcelRange](mdhelp/en/set-excelrange.md)
* [Import-Excel](mdhelp/en/import-excel.md)
* [Set-ExcelRow](mdhelp/en/set-excelrow.md)
* [Get-ExcelSheetInfo](mdhelp/en/get-excelsheetinfo.md)
* [New-PivotTableDefinition](mdhelp/en/new-pivottabledefinition.md)
* [Add-ExcelDataValidationRule](mdhelp/en/add-exceldatavalidationrule.md)
* [Join-Worksheet](mdhelp/en/join-worksheet.md)
* [New-ConditionalFormattingIconSet](mdhelp/en/new-conditionalformattingiconset.md)
* [Send-SQLDataToExcel](mdhelp/en/send-sqldatatoexcel.md)
* [Get-ExcelWorkbookInfo](mdhelp/en/get-excelworkbookinfo.md)
* [New-ConditionalText](mdhelp/en/new-conditionaltext.md)
* [Compare-WorkSheet](mdhelp/en/compare-worksheet.md)
* [New-ExcelChartDefinition](mdhelp/en/new-excelchartdefinition.md)
* [Remove-WorkSheet](mdhelp/en/remove-worksheet.md)
* [ConvertFrom-ExcelToSQLInsert](mdhelp/en/convertfrom-exceltosqlinsert.md)
* [Close-ExcelPackage](mdhelp/en/close-excelpackage.md)
* [Set-ExcelColumn](mdhelp/en/set-excelcolumn.md)
* [Add-WorkSheet](mdhelp/en/add-worksheet.md)
* [Add-ExcelTable](mdhelp/en/add-exceltable.md)
* [Convert-ExcelRangeToImage](mdhelp/en/convert-excelrangetoimage.md)
* [Add-ConditionalFormatting](mdhelp/en/add-conditionalformatting.md)
* [Update-FirstObjectProperties](mdhelp/en/update-firstobjectproperties.md)
* [Export-Excel](mdhelp/en/export-excel.md)
* [Select-Worksheet](mdhelp/en/select-worksheet.md)
* [Merge-Worksheet](mdhelp/en/merge-worksheet.md)
* [Merge-MultipleSheets](mdhelp/en/merge-multiplesheets.md)
* [Add-ExcelName](mdhelp/en/add-excelname.md)
* [ConvertFrom-ExcelSheet](mdhelp/en/convertfrom-excelsheet.md)
* [Add-PivotTable](mdhelp/en/add-pivottable.md)
* [Public](public/README.md)
* [Import-USPS](public/import-usps.md)
* [Get-Range](public/get-range.md)
* [Get-XYRange](public/get-xyrange.md)
* [Set-CellStyle](public/set-cellstyle.md)
* [Invoke-Sum](public/invoke-sum.md)
* [Get-ExcelColumnName](public/get-excelcolumnname.md)
* [Import-UPS](public/import-ups.md)
* [Set-WorksheetProtection](public/set-worksheetprotection.md)
* [New-Plot](public/new-plot.md)
* [Import-Html](public/import-html.md)
* [New-ExcelStyle](public/new-excelstyle.md)
* [ConvertFrom-ExcelData](public/convertfrom-exceldata.md)
* [ConvertTo-ExcelXlsx](public/convertto-excelxlsx.md)
* [New-PSItem](public/new-psitem.md)
* [Get-HtmlTable](public/get-htmltable.md)
* [Charting](charting/README.md)
* [LineChart](charting/linechart.md)
* [PieChart](charting/piechart.md)
* [ColumnChart](charting/columnchart.md)
* [BarChart](charting/barchart.md)
* [DoChart](charting/dochart.md)
* [Examples](examples/README.md)
* [Untitled](examples/untitled.md)
* [Charts](examples/charts/README.md)
* [Multiplecharts](examples/charts/multiplecharts.md)
* [Pivot](pivot/README.md)
* [Pivot](pivot/pivot.md)

2
charting/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Charting

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# BarChart
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
BarChart [[-targetData] <Object>] [[-title] <Object>] [[-ChartType] <eChartType>] [-NoLegend] [-ShowCategory]
[-ShowPercent] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ChartType
{{ Fill ChartType Description }}
```yaml
Type: eChartType
@@ -48,7 +44,6 @@ Accept wildcard characters: False
```
### -NoLegend
{{ Fill NoLegend Description }}
```yaml
Type: SwitchParameter
@@ -63,7 +58,6 @@ Accept wildcard characters: False
```
### -ShowCategory
{{ Fill ShowCategory Description }}
```yaml
Type: SwitchParameter
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -ShowPercent
{{ Fill ShowPercent Description }}
```yaml
Type: SwitchParameter
@@ -93,7 +86,6 @@ Accept wildcard characters: False
```
### -targetData
{{ Fill targetData Description }}
```yaml
Type: Object
@@ -108,7 +100,6 @@ Accept wildcard characters: False
```
### -title
{{ Fill title Description }}
```yaml
Type: Object
@@ -123,7 +114,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -132,6 +124,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# ColumnChart
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
ColumnChart [[-targetData] <Object>] [[-title] <Object>] [[-ChartType] <eChartType>] [-NoLegend]
[-ShowCategory] [-ShowPercent] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ChartType
{{ Fill ChartType Description }}
```yaml
Type: eChartType
@@ -48,7 +44,6 @@ Accept wildcard characters: False
```
### -NoLegend
{{ Fill NoLegend Description }}
```yaml
Type: SwitchParameter
@@ -63,7 +58,6 @@ Accept wildcard characters: False
```
### -ShowCategory
{{ Fill ShowCategory Description }}
```yaml
Type: SwitchParameter
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -ShowPercent
{{ Fill ShowPercent Description }}
```yaml
Type: SwitchParameter
@@ -93,7 +86,6 @@ Accept wildcard characters: False
```
### -targetData
{{ Fill targetData Description }}
```yaml
Type: Object
@@ -108,7 +100,6 @@ Accept wildcard characters: False
```
### -title
{{ Fill title Description }}
```yaml
Type: Object
@@ -123,7 +114,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -132,6 +124,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# DoChart
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
DoChart [[-targetData] <Object>] [[-title] <Object>] [[-ChartType] <eChartType>] [-NoLegend] [-ShowCategory]
[-ShowPercent]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ChartType
{{ Fill ChartType Description }}
```yaml
Type: eChartType
@@ -48,7 +44,6 @@ Accept wildcard characters: False
```
### -NoLegend
{{ Fill NoLegend Description }}
```yaml
Type: SwitchParameter
@@ -63,7 +58,6 @@ Accept wildcard characters: False
```
### -ShowCategory
{{ Fill ShowCategory Description }}
```yaml
Type: SwitchParameter
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -ShowPercent
{{ Fill ShowPercent Description }}
```yaml
Type: SwitchParameter
@@ -93,7 +86,6 @@ Accept wildcard characters: False
```
### -targetData
{{ Fill targetData Description }}
```yaml
Type: Object
@@ -108,7 +100,6 @@ Accept wildcard characters: False
```
### -title
{{ Fill title Description }}
```yaml
Type: Object
@@ -129,6 +120,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# LineChart
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
LineChart [[-targetData] <Object>] [[-title] <Object>] [[-ChartType] <eChartType>] [-NoLegend] [-ShowCategory]
[-ShowPercent] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ChartType
{{ Fill ChartType Description }}
```yaml
Type: eChartType
@@ -48,7 +44,6 @@ Accept wildcard characters: False
```
### -NoLegend
{{ Fill NoLegend Description }}
```yaml
Type: SwitchParameter
@@ -63,7 +58,6 @@ Accept wildcard characters: False
```
### -ShowCategory
{{ Fill ShowCategory Description }}
```yaml
Type: SwitchParameter
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -ShowPercent
{{ Fill ShowPercent Description }}
```yaml
Type: SwitchParameter
@@ -93,7 +86,6 @@ Accept wildcard characters: False
```
### -targetData
{{ Fill targetData Description }}
```yaml
Type: Object
@@ -108,7 +100,6 @@ Accept wildcard characters: False
```
### -title
{{ Fill title Description }}
```yaml
Type: Object
@@ -123,7 +114,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -132,6 +124,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# PieChart
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
PieChart [[-targetData] <Object>] [[-title] <Object>] [[-ChartType] <eChartType>] [-NoLegend] [-ShowCategory]
[-ShowPercent] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ChartType
{{ Fill ChartType Description }}
```yaml
Type: eChartType
@@ -48,7 +44,6 @@ Accept wildcard characters: False
```
### -NoLegend
{{ Fill NoLegend Description }}
```yaml
Type: SwitchParameter
@@ -63,7 +58,6 @@ Accept wildcard characters: False
```
### -ShowCategory
{{ Fill ShowCategory Description }}
```yaml
Type: SwitchParameter
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -ShowPercent
{{ Fill ShowPercent Description }}
```yaml
Type: SwitchParameter
@@ -93,7 +86,6 @@ Accept wildcard characters: False
```
### -targetData
{{ Fill targetData Description }}
```yaml
Type: Object
@@ -108,7 +100,6 @@ Accept wildcard characters: False
```
### -title
{{ Fill title Description }}
```yaml
Type: Object
@@ -123,7 +114,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -132,6 +124,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

2
examples/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Examples

View File

@@ -0,0 +1,2 @@
# Charts

View File

@@ -1,6 +1,8 @@
# Multiplecharts
## PowerShell
```powershell
```text
$xlFile = "$env:TEMP\ImportExcelExample.xlsx"
Remove-Item $xlFile -ErrorAction Ignore
@@ -21,4 +23,6 @@ $data | Export-Excel -Path $xlFile -AutoFilter -AutoNameRange -AutoSize -Show -E
```
## Result
![](https://raw.githubusercontent.com/dfinke/ImportExcel/master/Examples/Charts/Multiplecharts.png)

2
examples/untitled.md Normal file
View File

@@ -0,0 +1,2 @@
# Untitled

2
inferdata/README.md Normal file
View File

@@ -0,0 +1,2 @@
# InferData

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Invoke-AllTests
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Invoke-AllTests [[-target] <Object>] [-OnlyPassing] [-FirstOne]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -FirstOne
{{ Fill FirstOne Description }}
```yaml
Type: SwitchParameter
@@ -46,7 +42,6 @@ Accept wildcard characters: False
```
### -OnlyPassing
{{ Fill OnlyPassing Description }}
```yaml
Type: SwitchParameter
@@ -61,7 +56,6 @@ Accept wildcard characters: False
```
### -target
{{ Fill target Description }}
```yaml
Type: Object
@@ -82,6 +76,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Test-Boolean
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Test-Boolean [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```yaml
Type: Object
@@ -52,6 +48,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Test-Date
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Test-Date [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```yaml
Type: Object
@@ -52,6 +48,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Test-Integer
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Test-Integer [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```yaml
Type: Object
@@ -52,6 +48,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Test-Number
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Test-Number [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```yaml
Type: Object
@@ -52,6 +48,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Test-String
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Test-String [[-p] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -p
{{ Fill p Description }}
```yaml
Type: Object
@@ -52,6 +48,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,82 +0,0 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
schema: 2.0.0
---
# Get-ExcelWorkbookInfo
## SYNOPSIS
Retrieve information of an Excel workbook.
## SYNTAX
```
Get-ExcelWorkbookInfo [-Path] <String> [<CommonParameters>]
```
## DESCRIPTION
The Get-ExcelWorkbookInfo cmdlet retrieves information (LastModifiedBy, LastPrinted, Created, Modified, ...) fron an Excel workbook.
These are the same details that are visible in Windows Explorer when right clicking the Excel file, selecting Properties and check the Details tabpage.
## EXAMPLES
### EXAMPLE 1
```
Get-ExcelWorkbookInfo .\Test.xlsx
```
CorePropertiesXml : #document
Title :
Subject :
Author : Konica Minolta User
Comments :
Keywords :
LastModifiedBy : Bond, James (London) GBR
LastPrinted : 2017-01-21T12:36:11Z
Created : 17/01/2017 13:51:32
Category :
Status :
ExtendedPropertiesXml : #document
Application : Microsoft Excel
HyperlinkBase :
AppVersion : 14.0300
Company : Secret Service
Manager :
Modified : 10/02/2017 12:45:37
CustomPropertiesXml : #document
## PARAMETERS
### -Path
Specifies the path to the Excel file.
This parameter is required.
```yaml
Type: String
Parameter Sets: (All)
Aliases: FullName
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
CHANGELOG
2016/01/07 Added Created by Johan Akerstrom (https://github.com/CosmosKey)
## RELATED LINKS
[https://github.com/dfinke/ImportExcel](https://github.com/dfinke/ImportExcel)

2
mdhelp/README.md Normal file
View File

@@ -0,0 +1,2 @@
# mdHelp

2
mdhelp/en/README.md Normal file
View File

@@ -0,0 +1,2 @@
# en

View File

@@ -1,54 +1,63 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-ConditionalFormatting
## SYNOPSIS
Adds conditional formatting to all or part of a worksheet.
## SYNTAX
### NamedRule
```
```text
Add-ConditionalFormatting [-Address] <Object> [-WorkSheet <ExcelWorksheet>] [-RuleType] <eExcelConditionalFormattingRuleType> [-ForegroundColor <Object>] [-Reverse] [[-ConditionValue] <Object>] [[-ConditionValue2] <Object>] [-BackgroundColor <Object>] [-BackgroundPattern <ExcelFillStyle>] [-PatternColor <Object>] [-NumberFormat <Object>] [-Bold] [-Italic] [-Underline] [-StrikeThru] [-StopIfTrue] [-Priority <Int32>] [-PassThru] [<CommonParameters>]
```
### DataBar
```
```text
Add-ConditionalFormatting [-Address] <Object> [-WorkSheet <ExcelWorksheet>] -DataBarColor <Object> [-Priority <Int32>] [-PassThru] [<CommonParameters>]
```
### ThreeIconSet
```
```text
Add-ConditionalFormatting [-Address] <Object> [-WorkSheet <ExcelWorksheet>] -ThreeIconsSet <eExcelconditionalFormatting3IconsSetType> [-Reverse] [-Priority <Int32>] [-PassThru] [<CommonParameters>]
```
### FourIconSet
```
```text
Add-ConditionalFormatting [-Address] <Object> [-WorkSheet <ExcelWorksheet>] -FourIconsSet <eExcelconditionalFormatting4IconsSetType> [-Reverse] [-Priority <Int32>] [-PassThru] [<CommonParameters>]
```
### FiveIconSet
```
```text
Add-ConditionalFormatting [-Address] <Object> [-WorkSheet <ExcelWorksheet>] -FiveIconsSet <eExcelconditionalFormatting5IconsSetType> [-Reverse] [-Priority <Int32>] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
Conditional formatting allows Excel to:
* Mark cells with icons depending on their value
* Show a databar whose length indicates the value or a two or three color scale where the color indicates the relative value
* Change the color, font, or number format of cells which meet given criteria
Add-ConditionalFormatting allows these parameters to be set; for fine tuning of the rules, the -PassThru switch will return the rule so that you can modify things which are specific to that type of rule, example, the values which correspond to each icon in an Icon-Set.
Add-ConditionalFormatting allows these parameters to be set; for fine tuning of the rules, the -PassThru switch will return the rule so that you can modify things which are specific to that type of rule, example, the values which correspond to each icon in an Icon-Set.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $excel = $avdata | Export-Excel -Path (Join-path $FilePath "\Machines.XLSX" ) -WorksheetName "Server Anti-Virus" -AutoSize -FreezeTopRow -AutoFilter -PassThru
Add-ConditionalFormatting -WorkSheet $excel.Workbook.Worksheets[1] -Address "b2:b1048576" -ForeGroundColor "RED" -RuleType ContainsText -ConditionValue "2003"
Add-ConditionalFormatting -WorkSheet $excel.Workbook.Worksheets[1] -Address "i2:i1048576" -ForeGroundColor "RED" -RuleType ContainsText -ConditionValue "Disabled"
@@ -57,19 +66,19 @@ PS\> $excel = $avdata | Export-Excel -Path (Join-path $FilePath "\Machines.XLSX"
$excel.Save() ; $excel.Dispose()
```
Here Export-Excel is called with the -PassThru parameter, so the ExcelPackage object representing Machines.XLSX is stored in $Excel.The desired worksheet is selected, and then columns" B" and "I" are conditionally formatted (excluding the top row) to show red text if they contain "2003" or "Disabled" respectively.
Here Export-Excel is called with the -PassThru parameter, so the ExcelPackage object representing Machines.XLSX is stored in $Excel.The desired worksheet is selected, and then columns" B" and "I" are conditionally formatted \(excluding the top row\) to show red text if they contain "2003" or "Disabled" respectively.
A fixed date format is then applied to columns D to G, and the top row is formatted.
Finally the workbook is saved and the Excel package object is closed.
### EXAMPLE 2
```
```text
PS\> $r = Add-ConditionalFormatting -WorkSheet $excel.Workbook.Worksheets[1] -Range "B1:B100" -ThreeIconsSet Flags -Passthru
$r.Reverse = $true ; $r.Icon1.Type = "Num"; $r.Icon2.Type = "Num" ; $r.Icon2.value = 100 ; $r.Icon3.type = "Num" ;$r.Icon3.value = 1000
```
Again Export-Excel has been called with -PassThru leaving a package object in $Excel.
This time B1:B100 has been conditionally formatted with 3 icons, using the "Flags" Icon-Set.
@@ -77,14 +86,16 @@ This time B1:B100 has been conditionally formatted with 3 icons, using the "Flag
Add-ConditionalFormatting does not provide accessto every option in the formatting rule, so -PassThru has been used and the rule is modified to apply the flags in reverse order, and transitions between flags are set to 100 and 1000.
### EXAMPLE 3
```
```text
PS\> Add-ConditionalFormatting -WorkSheet $sheet -Range "D2:D1048576" -DataBarColor Red
```
This time $sheet holds an ExcelWorkshseet object and databars are added to column D, excluding the top row.
### EXAMPLE 4
```
```text
PS\> Add-ConditionalFormatting -Address $worksheet.cells["FinishPosition"] -RuleType Equal -ConditionValue 1 -ForeGroundColor Purple -Bold -Priority 1 -StopIfTrue
```
@@ -95,7 +106,8 @@ If a cell in the "FinishPosition" range is 1, then the text is turned to Bold &
This rule is moved to first in the priority list, and where cells have a value of 1, no other rules will be processed.
### EXAMPLE 5
```
```text
PS\> $excel = Get-ChildItem | Select-Object -Property Name,Length,LastWriteTime,CreationTime | Export-Excel "$env:temp\test43.xlsx" -PassThru -AutoSize
$ws = $excel.Workbook.Worksheets["Sheet1"]
$ws.Cells["E1"].Value = "SavedAt"
@@ -108,33 +120,33 @@ PS\> $excel = Get-ChildItem | Select-Object -Property Name,Length,LastWriteTime,
Add-ConditionalFormatting -WorkSheet $ws -address "D2:D$Lastrow" -RuleType Equal -ConditionValue "=C2" -ForeGroundColor Blue -StopIfTrue
Close-ExcelPackage -Show $excel
```
The first few lines of code export a list of file and directory names, sizes and dates to a spreadsheet.
It puts the date of the export in cell F1.
The first Conditional format changes the color of files and folders that begin with a ".", "_" or anything else which sorts before "A".
The first Conditional format changes the color of files and folders that begin with a ".", "\_" or anything else which sorts before "A".
The second Conditional format changes the Number format of numbers bigger than 1 million, for example 1,234,567,890 will dispay as "1,234.57M"
The third highlights datestamps of files less than a week old when the export was run; the = is necessary in the condition value otherwise the rule will look for the the text INT($F$1-7), and the cell address for the date is fixed using the standard Excel $ notation.
The third highlights datestamps of files less than a week old when the export was run; the = is necessary in the condition value otherwise the rule will look for the the text INT\($F$1-7\), and the cell address for the date is fixed using the standard Excel $ notation.
The final Conditional format looks for files which have not changed since they were created. Here the condition value is "=C2". The = sign means C2 is treated as a formula, not literal text. Unlike the file age, we want the cell used to change for each cell where the conditional format applies.
The first cell in the conditional format range is D2, which is compared against C2, then D3 is compared against C3 and so on.
A common mistake is to include the title row in the range and accidentally apply conditional formatting to it, or to begin the
range at row 2 but use row 1 as the starting point for comparisons.
The first cell in the conditional format range is D2, which is compared against C2, then D3 is compared against C3 and so on. A common mistake is to include the title row in the range and accidentally apply conditional formatting to it, or to begin the range at row 2 but use row 1 as the starting point for comparisons.
### EXAMPLE 6
```
```text
PS\> Add-ConditionalFormatting $ws.Cells["B:B"] GreaterThan 10000000 -Fore Red -Stop -Pri 1
```
This version shows the shortest syntax - the Address, Ruletype, and Conditionvalue can be identified from their position, and ForegroundColor,
StopIfTrue and Priority can all be shortend.
This version shows the shortest syntax - the Address, Ruletype, and Conditionvalue can be identified from their position, and ForegroundColor, StopIfTrue and Priority can all be shortend.
## PARAMETERS
### -Address
A block of cells to format - you can use a named range with -Address $ws.names\[1\] or $ws.cells\["RangeName"\]
```yaml
@@ -150,6 +162,7 @@ Accept wildcard characters: False
```
### -WorkSheet
The worksheet where the format is to be applied
```yaml
@@ -165,6 +178,7 @@ Accept wildcard characters: False
```
### -RuleType
A standard named-rule - Top / Bottom / Less than / Greater than / Contains etc.
```yaml
@@ -181,6 +195,7 @@ Accept wildcard characters: False
```
### -ForegroundColor
Text color for matching objects
```yaml
@@ -196,6 +211,7 @@ Accept wildcard characters: False
```
### -DataBarColor
Color for databar type charts
```yaml
@@ -211,8 +227,8 @@ Accept wildcard characters: False
```
### -ThreeIconsSet
One of the three-icon set types (e.g.
Traffic Lights)
One of the three-icon set types \(e.g. Traffic Lights\)
```yaml
Type: eExcelconditionalFormatting3IconsSetType
@@ -228,6 +244,7 @@ Accept wildcard characters: False
```
### -FourIconsSet
A four-icon set name
```yaml
@@ -244,6 +261,7 @@ Accept wildcard characters: False
```
### -FiveIconsSet
A five-icon set name
```yaml
@@ -260,6 +278,7 @@ Accept wildcard characters: False
```
### -Reverse
Use the Icon-Set in reverse order, or reverse the orders of Two- & Three-Color Scales
```yaml
@@ -275,7 +294,8 @@ Accept wildcard characters: False
```
### -ConditionValue
A value for the condition (for example 2000 if the test is 'lessthan 2000'; Formulas should begin with "=" )
A value for the condition \(for example 2000 if the test is 'lessthan 2000'; Formulas should begin with "=" \)
```yaml
Type: Object
@@ -290,6 +310,7 @@ Accept wildcard characters: False
```
### -ConditionValue2
A second value for the conditions like "Between X and Y"
```yaml
@@ -305,6 +326,7 @@ Accept wildcard characters: False
```
### -BackgroundColor
Background color for matching items
```yaml
@@ -320,6 +342,7 @@ Accept wildcard characters: False
```
### -BackgroundPattern
Background pattern for matching items
```yaml
@@ -336,6 +359,7 @@ Accept wildcard characters: False
```
### -PatternColor
Secondary color when a background pattern requires it
```yaml
@@ -351,6 +375,7 @@ Accept wildcard characters: False
```
### -NumberFormat
Sets the numeric format for matching items
```yaml
@@ -366,6 +391,7 @@ Accept wildcard characters: False
```
### -Bold
Put matching items in bold face
```yaml
@@ -381,6 +407,7 @@ Accept wildcard characters: False
```
### -Italic
Put matching items in italic
```yaml
@@ -396,6 +423,7 @@ Accept wildcard characters: False
```
### -Underline
Underline matching items
```yaml
@@ -411,6 +439,7 @@ Accept wildcard characters: False
```
### -StrikeThru
Strikethrough text of matching items
```yaml
@@ -426,6 +455,7 @@ Accept wildcard characters: False
```
### -StopIfTrue
Prevent the processing of subsequent rules
```yaml
@@ -441,6 +471,7 @@ Accept wildcard characters: False
```
### -Priority
Set the sequence for rule processing
```yaml
@@ -456,6 +487,7 @@ Accept wildcard characters: False
```
### -PassThru
If specified pass the rule back to the caller to allow additional customization.
```yaml
@@ -471,7 +503,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -480,3 +513,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,43 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-ExcelChart
## SYNOPSIS
Creates a chart in an existing Excel worksheet.
## SYNTAX
### Worksheet (Default)
```
### Worksheet \(Default\)
```text
Add-ExcelChart [-Title <String>] [-ChartType <eChartType>] [-ChartTrendLine <eTrendLine[]>] [-XRange <Object>] [-YRange <Object>] [-Width <Int32>] [-Height <Int32>] [-Row <Int32>] [-RowOffSetPixels <Int32>] [-Column <Int32>] [-ColumnOffSetPixels <Int32>] [-LegendPosition <eLegendPosition>] [-LegendSize <Object>] [-LegendBold] [-NoLegend] [-ShowCategory] [-ShowPercent] [-SeriesHeader <String[]>] [-TitleBold] [-TitleSize <Int32>] [-XAxisTitleText <String>] [-XAxisTitleBold] [-XAxisTitleSize <Object>] [-XAxisNumberformat <String>] [-XMajorUnit <Object>] [-XMinorUnit <Object>] [-XMaxValue <Object>] [-XMinValue <Object>] [-XAxisPosition <eAxisPosition>] [-YAxisTitleText <String>] [-YAxisTitleBold] [-YAxisTitleSize <Object>] [-YAxisNumberformat <String>] [-YMajorUnit <Object>] [-YMinorUnit <Object>] [-YMaxValue <Object>] [-YMinValue <Object>] [-YAxisPosition <eAxisPosition>] [-PassThru] [<CommonParameters>]
```
### PivotTable
```
```text
Add-ExcelChart -PivotTable <ExcelPivotTable> [-Title <String>] [-ChartType <eChartType>] [-ChartTrendLine <eTrendLine[]>] [-XRange <Object>] [-YRange <Object>] [-Width <Int32>] [-Height <Int32>] [-Row <Int32>] [-RowOffSetPixels <Int32>] [-Column <Int32>] [-ColumnOffSetPixels <Int32>] [-LegendPosition <eLegendPosition>] [-LegendSize <Object>] [-LegendBold] [-NoLegend] [-ShowCategory] [-ShowPercent] [-SeriesHeader <String[]>] [-TitleBold] [-TitleSize <Int32>] [-XAxisTitleText <String>] [-XAxisTitleBold] [-XAxisTitleSize <Object>] [-XAxisNumberformat <String>] [-XMajorUnit <Object>] [-XMinorUnit <Object>] [-XMaxValue <Object>] [-XMinValue <Object>] [-XAxisPosition <eAxisPosition>] [-YAxisTitleText <String>] [-YAxisTitleBold] [-YAxisTitleSize <Object>] [-YAxisNumberformat <String>] [-YMajorUnit <Object>] [-YMinorUnit <Object>] [-YMaxValue <Object>] [-YMinValue <Object>] [-YAxisPosition <eAxisPosition>] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
Creates a chart.
It is possible to configure the type of chart, the range of X values (labels) and Y values, the title, the legend, the ranges for both axes, the format and position of the axes.
It is possible to configure the type of chart, the range of X values \(labels\) and Y values, the title, the legend, the ranges for both axes, the format and position of the axes.
Normally the command does not return anything, but if -passthru is specified the chart is returned so that it can be customized.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $Excel = ConvertFrom-Csv @"
Product, City, Sales
Apple, London, 300
@@ -46,15 +51,15 @@ PS\> $Excel = ConvertFrom-Csv @"
Close-ExcelPackage -Show $Excel
```
The first command expands a multi-line string into 6 rows of data which is exported to new Excel file; leaving an ExcelPackage object in $excel
The second command adds a chart - the cell ranges are explicitly specified.
The first command expands a multi-line string into 6 rows of data which is exported to new Excel file; leaving an ExcelPackage object in $excel The second command adds a chart - the cell ranges are explicitly specified.
Note that the XRange (labels) is TWO columns wide and the chart will combine the name of the product and the name of the City to create the label.
Note that the XRange \(labels\) is TWO columns wide and the chart will combine the name of the product and the name of the City to create the label.
The width of the chart is set explictly, the default legend is used and there is no Chart title.
### EXAMPLE 2
```
```text
PS\> $Excel = Invoke-Sum (Get-Process) Company Handles, PM, VirtualMemorySize | Export-Excel $path -AutoSize -ExcelChartDefinition $c -AutoNameRange -PassThru
Add-ExcelChart -Worksheet $Excel.Workbook.Worksheets[1] -Title "VM use" -ChartType PieExploded3D -XRange "Name" -YRange "VirtualMemorySize" -NoLegend -ShowCategory
Close-ExcelPackage $Excel -Show
@@ -67,7 +72,8 @@ The Second line uses the ranges to specify a chart - the labels come from the ra
The chart is specified as a 3D exploded PIE chart, with a title of "VM Use" and instead of a legend the the pie slices are identified with a label.
### EXAMPLE 3
```
```text
PS\> $Excel = Invoke-Sum (Get-Process) Company Handles, PM, VirtualMemorySize | Export-Excel test.xlsx -TableName Processes -PassThru
Add-ExcelChart -Worksheet $Excel.Workbook.Worksheets[1] -Title Stats -ChartType LineMarkersStacked -XRange "Processes[Name]" -YRange "Processes[PM]", "Processes[VirtualMemorySize]" -SeriesHeader 'PM', 'VMSize'
Close-ExcelPackage $Excel -Show
@@ -75,21 +81,19 @@ PS\> $Excel = Invoke-Sum (Get-Process) Company Handles, PM, VirtualMemorySize |
The first line exports information to a table in new file; and captures the excel Package object in $Excel
The second line creates a chart on the first page of the work sheet, using the notation "TableName[ColumnnName]" to refer to the data, the labels come Name column in the table, and the data series from its PM and VirtualMemorySize columns.
The display names for these in the header are set to 'PM' and 'VMSize'.
The second line creates a chart on the first page of the work sheet, using the notation "TableName\[ColumnnName\]" to refer to the data, the labels come Name column in the table, and the data series from its PM and VirtualMemorySize columns. The display names for these in the header are set to 'PM' and 'VMSize'.
### EXAMPLE 4
```
```text
PS\> $excel = 0..360 | ForEach-Object {[pscustomobject][ordered]@{x = $_; Sinx = "=Sin(Radians(x)) "}} | Export-Excel -AutoNameRange -Path Text.xlsx -WorkSheetname SinX -PassThru
Add-ExcelChart -Worksheet $excel.Workbook.Worksheets["Sinx"] -ChartType line -XRange "X" -YRange "Sinx" -Title "Graph of Sine X" -TitleBold -TitleSize 14 \`
-Column 2 -ColumnOffSetPixels 35 -Width 800 -XAxisTitleText "Degrees" -XAxisTitleBold -XAxisTitleSize 12 -XMajorUnit 30 -XMinorUnit 10 -XMinValue 0 -XMaxValue 361 -XAxisNumberformat "000" \`
-YMinValue -1.25 -YMaxValue 1.25 -YMajorUnit 0.25 -YAxisNumberformat "0.00" -YAxisTitleText "Sine" -YAxisTitleBold -YAxisTitleSize 12 \`
-SeriesHeader "Sin(x)" -LegendSize 8 -legendBold -LegendPosition Bottom
Close-ExcelPackage $Excel -Show
```
The first line puts numbers from 0 to 360 into a sheet, as the first column, and a formula to calculate the Sine of that number of number of degrees in the second column. It creates named-ranges for the two columns - "X" and "SinX" respectively
The Add-ExcelChart command adds a chart to that worksheet, specifying a line chart with the X values coming from named-range "X" and the Y values coming from named-range "SinX". The chart has a title, and is positioned to the right of column 2 and sized 800 pixels wide
@@ -98,11 +102,12 @@ The X-axis is labelled "Degrees", in bold 12 point type and runs from 0 to 361 w
The Y-axis is labelled "Sine" and to allow some room above and below its scale runs from -1.25 to 1.25, and is marked off in units of 0.25 shown to two decimal places.
The key will for the chart will be at the bottom in 8 point bold type and the line will be named "Sin(x)".
The key will for the chart will be at the bottom in 8 point bold type and the line will be named "Sin\(x\)".
## PARAMETERS
### -Worksheet
An existing Sheet where the chart will be created.
```yaml
@@ -118,6 +123,7 @@ Accept wildcard characters: False
```
### -PivotTable
Instead of specify X and Y ranges, get data from a PivotTable by passing a PivotTable Object.
```yaml
@@ -133,6 +139,7 @@ Accept wildcard characters: False
```
### -Title
The title for the chart.
```yaml
@@ -148,8 +155,8 @@ Accept wildcard characters: False
```
### -ChartType
One of the built-in chart types, such as Pie, ClusteredColumn, Line etc.
Defaults to "ColumnStacked".
One of the built-in chart types, such as Pie, ClusteredColumn, Line etc. Defaults to "ColumnStacked".
```yaml
Type: eChartType
@@ -165,7 +172,6 @@ Accept wildcard characters: False
```
### -ChartTrendLine
{{ Fill ChartTrendLine Description }}
```yaml
Type: eTrendLine[]
@@ -181,6 +187,7 @@ Accept wildcard characters: False
```
### -XRange
The range of cells containing values for the X-Axis - usually labels.
```yaml
@@ -196,7 +203,8 @@ Accept wildcard characters: False
```
### -YRange
The range(s) of cells holding values for the Y-Axis - usually "data".
The range\(s\) of cells holding values for the Y-Axis - usually "data".
```yaml
Type: Object
@@ -211,6 +219,7 @@ Accept wildcard characters: False
```
### -Width
Width of the chart in Pixels; defaults to 500.
```yaml
@@ -226,6 +235,7 @@ Accept wildcard characters: False
```
### -Height
Height of the chart in Pixels; defaults to 350.
```yaml
@@ -241,7 +251,8 @@ Accept wildcard characters: False
```
### -Row
Row position of the top left corner of the chart. ) places at the top of the sheet, 1 below row 1 and so on.
Row position of the top left corner of the chart. \) places at the top of the sheet, 1 below row 1 and so on.
```yaml
Type: Int32
@@ -256,6 +267,7 @@ Accept wildcard characters: False
```
### -RowOffSetPixels
Offset to position the chart by a fraction of a row.
```yaml
@@ -271,6 +283,7 @@ Accept wildcard characters: False
```
### -Column
Column position of the top left corner of the chart; 0 places at the edge of the sheet 1 to the right of column A and so on.
```yaml
@@ -286,6 +299,7 @@ Accept wildcard characters: False
```
### -ColumnOffSetPixels
Offset to position the chart by a fraction of a column.
```yaml
@@ -301,6 +315,7 @@ Accept wildcard characters: False
```
### -LegendPosition
Location of the key, either left, right, top, bottom or TopRight.
```yaml
@@ -317,6 +332,7 @@ Accept wildcard characters: False
```
### -LegendSize
Font size for the key.
```yaml
@@ -332,6 +348,7 @@ Accept wildcard characters: False
```
### -LegendBold
Sets the key in bold type.
```yaml
@@ -347,6 +364,7 @@ Accept wildcard characters: False
```
### -NoLegend
If specified, turns of display of the key. If you only have one data series it may be preferable to use the title to say what the chart is.
```yaml
@@ -362,6 +380,7 @@ Accept wildcard characters: False
```
### -ShowCategory
Attaches a category label, in charts which support this.
```yaml
@@ -377,6 +396,7 @@ Accept wildcard characters: False
```
### -ShowPercent
Attaches a percentage label, in charts which support this.
```yaml
@@ -392,7 +412,8 @@ Accept wildcard characters: False
```
### -SeriesHeader
Specify explicit name(s) for the data series, which will appear in the legend/key. The contents of a cell can be specified in the from =Sheet9!Z10 .
Specify explicit name\(s\) for the data series, which will appear in the legend/key. The contents of a cell can be specified in the from =Sheet9!Z10 .
```yaml
Type: String[]
@@ -407,6 +428,7 @@ Accept wildcard characters: False
```
### -TitleBold
Sets the title in bold face.
```yaml
@@ -422,6 +444,7 @@ Accept wildcard characters: False
```
### -TitleSize
Sets the point size for the title.
```yaml
@@ -437,6 +460,7 @@ Accept wildcard characters: False
```
### -XAxisTitleText
Specifies a title for the X-axis.
```yaml
@@ -452,6 +476,7 @@ Accept wildcard characters: False
```
### -XAxisTitleBold
Sets the X-axis title in bold face.
```yaml
@@ -467,6 +492,7 @@ Accept wildcard characters: False
```
### -XAxisTitleSize
Sets the font size for the axis title.
```yaml
@@ -482,7 +508,8 @@ Accept wildcard characters: False
```
### -XAxisNumberformat
A number formatting string, like "#,##0.00", for numbers along the X-axis.
A number formatting string, like "\#,\#\#0.00", for numbers along the X-axis.
```yaml
Type: String
@@ -497,6 +524,7 @@ Accept wildcard characters: False
```
### -XMajorUnit
Spacing for the major gridlines / tick marks along the X-axis.
```yaml
@@ -512,6 +540,7 @@ Accept wildcard characters: False
```
### -XMinorUnit
Spacing for the minor gridlines / tick marks along the X-axis.
```yaml
@@ -527,6 +556,7 @@ Accept wildcard characters: False
```
### -XMaxValue
Maximum value for the scale along the X-axis.
```yaml
@@ -542,6 +572,7 @@ Accept wildcard characters: False
```
### -XMinValue
Minimum value for the scale along the X-axis.
```yaml
@@ -557,7 +588,8 @@ Accept wildcard characters: False
```
### -XAxisPosition
Position for the X-axis (Top or Bottom).
Position for the X-axis \(Top or Bottom\).
```yaml
Type: eAxisPosition
@@ -573,6 +605,7 @@ Accept wildcard characters: False
```
### -YAxisTitleText
Specifies a title for the Y-axis.
```yaml
@@ -588,6 +621,7 @@ Accept wildcard characters: False
```
### -YAxisTitleBold
Sets the Y-axis title in bold face.
```yaml
@@ -603,6 +637,7 @@ Accept wildcard characters: False
```
### -YAxisTitleSize
Sets the font size for the Y-axis title
```yaml
@@ -618,7 +653,8 @@ Accept wildcard characters: False
```
### -YAxisNumberformat
A number formatting string, like "#,##0.00", for numbers on the Y-axis.
A number formatting string, like "\#,\#\#0.00", for numbers on the Y-axis.
```yaml
Type: String
@@ -633,6 +669,7 @@ Accept wildcard characters: False
```
### -YMajorUnit
Spacing for the major gridlines / tick marks on the Y-axis.
```yaml
@@ -648,6 +685,7 @@ Accept wildcard characters: False
```
### -YMinorUnit
Spacing for the minor gridlines / tick marks on the Y-axis.
```yaml
@@ -663,6 +701,7 @@ Accept wildcard characters: False
```
### -YMaxValue
Maximum value on the Y-axis.
```yaml
@@ -678,6 +717,7 @@ Accept wildcard characters: False
```
### -YMinValue
Minimum value on the Y-axis.
```yaml
@@ -693,7 +733,8 @@ Accept wildcard characters: False
```
### -YAxisPosition
Position for the Y-axis (Left or Right).
Position for the Y-axis \(Left or Right\).
```yaml
Type: eAxisPosition
@@ -709,6 +750,7 @@ Accept wildcard characters: False
```
### -PassThru
Add-Excel chart doesn't normally return anything, but if -PassThru is specified it returns the newly created chart to allow it to be fine tuned.
```yaml
@@ -724,13 +766,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.Drawing.Chart.ExcelChart
## NOTES
## RELATED LINKS

View File

@@ -1,36 +1,40 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-ExcelDataValidationRule
## SYNOPSIS
Adds data validation to a range of cells
## SYNTAX
```
```text
Add-ExcelDataValidationRule [[-Range] <Object>] [-WorkSheet <ExcelWorksheet>] [-ValidationType <Object>] [-Operator <ExcelDataValidationOperator>] [-Value <Object>] [-Value2 <Object>] [-Formula <Object>] [-Formula2 <Object>] [-ValueSet <Object>] [-ShowErrorMessage] [-ErrorStyle <ExcelDataValidationWarningStyle>] [-ErrorTitle <String>] [-ErrorBody <String>] [-ShowPromptMessage] [-PromptBody <String>] [-PromptTitle <String>] [-NoBlank <String>] [<CommonParameters>]
```
## DESCRIPTION
Excel supports the validation of user input, and ranges of cells can be marked to only contain numbers, or date, or Text up to a particular length, or selections from a list. This command adds validation rules to a worksheet.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\>Add-ExcelDataValidationRule -WorkSheet $PlanSheet -Range 'E2:E1001' -ValidationType Integer -Operator between -Value 0 -Value2 100 \`
-ShowErrorMessage -ErrorStyle stop -ErrorTitle 'Invalid Data' -ErrorBody 'Percentage must be a whole number between 0 and 100'
```
This defines a validation rule on cells E2-E1001; it is an integer rule and requires a number between 0 and 100. If a value is input with a fraction, negative number, or positive number \> 100 a stop dialog box appears.
This defines a validation rule on cells E2-E1001; it is an integer rule and requires a number between 0 and 100. If a value is input with a fraction, negative number, or positive number &gt; 100 a stop dialog box appears.
### EXAMPLE 2
```
```text
PS\>Add-ExcelDataValidationRule -WorkSheet $PlanSheet -Range 'B2:B1001' -ValidationType List -Formula 'values!$a$2:$a$1000'
-ShowErrorMessage -ErrorStyle stop -ErrorTitle 'Invalid Data' -ErrorBody 'You must select an item from the list'
```
@@ -40,16 +44,18 @@ This defines a list rule on Cells B2:1001, and the posible values are in a sheet
If $ signs were left out of the fomrmula B2 would be checked against A2-A1000, B3, against A3-A1001, B4 against A4-A1002 up to B1001 beng checked against A1001-A1999
### EXAMPLE 3
```
```text
PS\>Add-ExcelDataValidationRule -WorkSheet $PlanSheet -Range 'I2:N1001' -ValidationType List -ValueSet @('yes','YES','Yes')
-ShowErrorMessage -ErrorStyle stop -ErrorTitle 'Invalid Data' -ErrorBody "Select Yes or leave blank for no"
```
Similar to the previous example but this time provides a value set; Excel comparisons are case sesnsitive, hence 3 versions of Yes.
Similar to the previous example but this time provides a value set; Excel comparisons are case sesnsitive, hence 3 versions of Yes.
## PARAMETERS
### -Range
The range of cells to be validate, for example, "B2:C100"
```yaml
@@ -65,6 +71,7 @@ Accept wildcard characters: False
```
### -WorkSheet
The worksheet where the cells should be validated
```yaml
@@ -80,6 +87,7 @@ Accept wildcard characters: False
```
### -ValidationType
An option corresponding to a choice from the 'Allow' pull down on the settings page in the Excel dialog. "Any" means "any allowed" - in other words, no Validation
```yaml
@@ -95,6 +103,7 @@ Accept wildcard characters: False
```
### -Operator
The operator to apply to Decimal, Integer, TextLength, DateTime and time fields, for example "equal" or "between"
```yaml
@@ -111,6 +120,7 @@ Accept wildcard characters: False
```
### -Value
For Decimal, Integer, TextLength, DateTime the \[first\] data value
```yaml
@@ -126,6 +136,7 @@ Accept wildcard characters: False
```
### -Value2
When using the between operator, the second data value
```yaml
@@ -141,8 +152,8 @@ Accept wildcard characters: False
```
### -Formula
The \[first\] data value as a formula.
Use absolute formulas $A$1 if (e.g.) you want all cells to check against the same list
The \[first\] data value as a formula. Use absolute formulas $A$1 if \(e.g.\) you want all cells to check against the same list
```yaml
Type: Object
@@ -157,6 +168,7 @@ Accept wildcard characters: False
```
### -Formula2
When using the between operator, the second data value as a formula
```yaml
@@ -172,7 +184,8 @@ Accept wildcard characters: False
```
### -ValueSet
When using the list validation type, a set of values (rather than refering to Sheet!B$2:B$100 )
When using the list validation type, a set of values \(rather than refering to Sheet!B$2:B$100 \)
```yaml
Type: Object
@@ -187,6 +200,7 @@ Accept wildcard characters: False
```
### -ShowErrorMessage
Corresponds to the the 'Show Error alert ...' check box on error alert page in the Excel dialog
```yaml
@@ -202,6 +216,7 @@ Accept wildcard characters: False
```
### -ErrorStyle
Stop, Warning, or Infomation, corresponding to to the style setting in the Excel dialog
```yaml
@@ -218,6 +233,7 @@ Accept wildcard characters: False
```
### -ErrorTitle
The title for the message box corresponding to to the title setting in the Excel dialog
```yaml
@@ -233,6 +249,7 @@ Accept wildcard characters: False
```
### -ErrorBody
The error message corresponding to to the Error message setting in the Excel dialog
```yaml
@@ -248,6 +265,7 @@ Accept wildcard characters: False
```
### -ShowPromptMessage
Corresponds to the the 'Show Input message ...' check box on input message page in the Excel dialog
```yaml
@@ -263,6 +281,7 @@ Accept wildcard characters: False
```
### -PromptBody
The prompt message corresponding to to the Input message setting in the Excel dialog
```yaml
@@ -278,6 +297,7 @@ Accept wildcard characters: False
```
### -PromptTitle
The title for the message box corresponding to to the title setting in the Excel dialog
```yaml
@@ -293,6 +313,7 @@ Accept wildcard characters: False
```
### -NoBlank
By default the 'Ignore blank' option will be selected, unless NoBlank is sepcified.
```yaml
@@ -308,7 +329,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -317,3 +339,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,28 +1,31 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-ExcelName
## SYNOPSIS
Adds a named-range to an existing Excel worksheet.
## SYNTAX
```
```text
Add-ExcelName [-Range] <ExcelRange> [[-RangeName] <String>] [<CommonParameters>]
```
## DESCRIPTION
It is often helpful to be able to refer to sets of cells with a name rather than using their co-ordinates; Add-ExcelName sets up these names.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Add-ExcelName -Range $ws.Cells[$dataRange] -RangeName $rangeName
```
@@ -31,6 +34,7 @@ $WS is a worksheet, and $dataRange is a string describing a range of cells - for
## PARAMETERS
### -Range
The range of cells to assign as a name.
```yaml
@@ -46,6 +50,7 @@ Accept wildcard characters: False
```
### -RangeName
The name to assign to the range. If the name exists it will be updated to the new range. If no name is specified, the first cell in the range will be used as the name.
```yaml
@@ -61,7 +66,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -70,3 +76,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,22 +1,24 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-ExcelTable
## SYNOPSIS
Adds Tables to Excel workbooks.
## SYNTAX
```
```text
Add-ExcelTable [-Range] <ExcelRange> [[-TableName] <String>] [[-TableStyle] <TableStyles>] [-ShowHeader] [-ShowFilter] [-ShowTotal] [[-TotalSettings] <Hashtable>] [-ShowFirstColumn] [-ShowLastColumn] [-ShowRowStripes] [-ShowColumnStripes] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
Unlike named ranges, where the name only needs to be unique within a sheet, Table names must be unique in the workbook.
Tables carry formatting and by default have a filter.
@@ -26,23 +28,25 @@ The filter, header, totals, first and last column highlights can all be configur
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Add-ExcelTable -Range $ws.Cells[$dataRange] -TableName $TableName
```
$WS is a worksheet, and $dataRange is a string describing a range of cells - for example "A1:Z10". This range which will become a table, named $TableName
### EXAMPLE 2
```
```text
PS\> Add-ExcelTable -Range $ws.cells[$($ws.Dimension.address)] -TableStyle Light1 -TableName Musictable -ShowFilter:$false -ShowTotal -ShowFirstColumn
```
Again $ws is a worksheet, range here is the whole of the active part of the worksheet.
The table style and name are set, the filter is turned off, and a "Totals" row added, and first column is set in bold.
Again $ws is a worksheet, range here is the whole of the active part of the worksheet. The table style and name are set, the filter is turned off, and a "Totals" row added, and first column is set in bold.
## PARAMETERS
### -Range
The range of cells to assign to a table.
```yaml
@@ -58,6 +62,7 @@ Accept wildcard characters: False
```
### -TableName
The name for the Table - this should be unqiue in the Workbook - auto generated names will be used if this is left empty.
```yaml
@@ -73,6 +78,7 @@ Accept wildcard characters: False
```
### -TableStyle
The Style for the table, by default "Medium6" is used
```yaml
@@ -89,6 +95,7 @@ Accept wildcard characters: False
```
### -ShowHeader
By default the header row is shown - it can be turned off with -ShowHeader:$false.
```yaml
@@ -104,6 +111,7 @@ Accept wildcard characters: False
```
### -ShowFilter
By default the filter is enabled - it can be turned off with -ShowFilter:$false.
```yaml
@@ -119,6 +127,7 @@ Accept wildcard characters: False
```
### -ShowTotal
Show total adds a totals row. This does not automatically sum the columns but provides a drop-down in each to select sum, average etc
```yaml
@@ -134,7 +143,8 @@ Accept wildcard characters: False
```
### -TotalSettings
A HashTable in the form ColumnName = "Average"|"Count"|"CountNums"|"Max"|"Min"|"None"|"StdDev"|"Sum"|"Var" - if specified, -ShowTotal is not needed.
A HashTable in the form ColumnName = "Average"\|"Count"\|"CountNums"\|"Max"\|"Min"\|"None"\|"StdDev"\|"Sum"\|"Var" - if specified, -ShowTotal is not needed.
```yaml
Type: Hashtable
@@ -149,6 +159,7 @@ Accept wildcard characters: False
```
### -ShowFirstColumn
Highlights the first column in bold.
```yaml
@@ -164,6 +175,7 @@ Accept wildcard characters: False
```
### -ShowLastColumn
Highlights the last column in bold.
```yaml
@@ -179,6 +191,7 @@ Accept wildcard characters: False
```
### -ShowRowStripes
By default the table formats show striped rows, the can be turned off with -ShowRowStripes:$false
```yaml
@@ -194,6 +207,7 @@ Accept wildcard characters: False
```
### -ShowColumnStripes
Turns on column stripes.
```yaml
@@ -209,6 +223,7 @@ Accept wildcard characters: False
```
### -PassThru
If -PassThru is specified, the table object will be returned to allow additional changes to be made.
```yaml
@@ -224,13 +239,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.Table.ExcelTable
## NOTES
## RELATED LINKS

View File

@@ -1,40 +1,44 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-PivotTable
## SYNOPSIS
Adds a PivotTable (and optional PivotChart) to a workbook.
Adds a PivotTable \(and optional PivotChart\) to a workbook.
## SYNTAX
### ChartbyParams (Default)
```
### ChartbyParams \(Default\)
```text
Add-PivotTable -PivotTableName <String> [-Address <ExcelAddressBase>] [-ExcelPackage <Object>] [-SourceWorkSheet <Object>] [-SourceRange <Object>] [-PivotRows <Object>] [-PivotData <Object>] [-PivotColumns <Object>] [-PivotFilter <Object>] [-PivotDataToColumn] [-PivotTotals <String>] [-NoTotalsInPivot] [-GroupDateRow <String>] [-GroupDatePart <eDateGroupBy[]>] [-GroupNumericRow <String>] [-GroupNumericMin <Double>] [-GroupNumericMax <Double>] [-GroupNumericInterval <Double>] [-PivotNumberFormat <String>] [-PivotTableStyle <TableStyles>] [-IncludePivotChart] [-ChartTitle <String>] [-ChartHeight <Int32>] [-ChartWidth <Int32>] [-ChartRow <Int32>] [-ChartColumn <Int32>] [-ChartRowOffSetPixels <Int32>] [-ChartColumnOffSetPixels <Int32>] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-Activate] [-PassThru] [<CommonParameters>]
```
### ChartbyDef
```
```text
Add-PivotTable -PivotTableName <String> [-Address <ExcelAddressBase>] [-ExcelPackage <Object>] [-SourceWorkSheet <Object>] [-SourceRange <Object>] [-PivotRows <Object>] [-PivotData <Object>] [-PivotColumns <Object>] [-PivotFilter <Object>] [-PivotDataToColumn] [-PivotTotals <String>] [-NoTotalsInPivot] [-GroupDateRow <String>] [-GroupDatePart <eDateGroupBy[]>] [-GroupNumericRow <String>] [-GroupNumericMin <Double>] [-GroupNumericMax <Double>] [-GroupNumericInterval <Double>] [-PivotNumberFormat <String>] [-PivotTableStyle <TableStyles>] -PivotChartDefinition <Object> [-Activate] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
If the PivotTable already exists, the source data will be updated.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $excel = Get-Service | Export-Excel -Path test.xlsx -WorksheetName Services -PassThru -AutoSize -DisplayPropertySet -TableName ServiceTable -Title "Services on $Env:COMPUTERNAME"
Add-PivotTable -ExcelPackage $excel -PivotTableName ServiceSummary -SourceRange $excel.Workbook.Worksheets\[1\].Tables\[0\].Address -PivotRows Status -PivotData Name -NoTotalsInPivot -Activate
Close-ExcelPackage $excel -Show
```
This exports data to new workbook and creates a table with the data in it.
The Pivot table is added on its own page, the table created in the first command is used as the source for the PivotTable; which counts the service names in for each Status.
@@ -42,7 +46,8 @@ The Pivot table is added on its own page, the table created in the first command
At the end the Pivot page is made active.
### EXAMPLE 2
```
```text
PS\> $chartdef = New-ExcelChartDefinition -Title "Gross and net by city and product" -ChartType ColumnClustered `
-Column 11 -Width 500 -Height 360 -YMajorUnit 500 -YMinorUnit 100 -YAxisNumberformat "$#,##0" -LegendPosition Bottom
$excel = ConvertFrom-Csv @"
@@ -66,12 +71,13 @@ Then it exports some data to an XLSX file and keeps the file open.
The next step is to add the pivot table, normally this would be on its own sheet in the workbook, but here -Address is specified to place it beside the data.
The Add-Pivot table is given the chart definition and told to create a tale using the City field to create rows, the Product field to create columns and the data should be the sum of the gross field and the sum of the net field; grand totals for both gross and net are included for rows (Cities) and columns (Products) and the data is explicitly formatted as a currency.
The Add-Pivot table is given the chart definition and told to create a tale using the City field to create rows, the Product field to create columns and the data should be the sum of the gross field and the sum of the net field; grand totals for both gross and net are included for rows \(Cities\) and columns \(Products\) and the data is explicitly formatted as a currency.
Note that in the chart definition the number format for the axis does not include any fraction part.
### EXAMPLE 3
```
```text
PS> $excel = Convertfrom-csv @"
Location,OrderDate,quantity
Boston,1/1/2017,100
@@ -103,7 +109,6 @@ Boston,2/18/2018,1000
Close-ExcelPackage $excel -Show
```
Here the data contains dates formatted as strings using US format.
These are converted to DateTime objects before being exported to Excel; the "OrderDate" column is formatted with the local short-date style.
@@ -119,6 +124,7 @@ Finally the workbook is saved and shown in Excel.
## PARAMETERS
### -PivotTableName
Name for the new PivotTable - this will be the name of a sheet in the Workbook.
```yaml
@@ -134,7 +140,8 @@ Accept wildcard characters: False
```
### -Address
By default, a PivotTable will be created on its own sheet, but it can be created on an existing sheet by giving the address where the top left corner of the table should go. (Allow two rows for the filter if one is used.)
By default, a PivotTable will be created on its own sheet, but it can be created on an existing sheet by giving the address where the top left corner of the table should go. \(Allow two rows for the filter if one is used.\)
```yaml
Type: ExcelAddressBase
@@ -149,6 +156,7 @@ Accept wildcard characters: False
```
### -ExcelPackage
An Excel-package object for the workbook.
```yaml
@@ -164,6 +172,7 @@ Accept wildcard characters: False
```
### -SourceWorkSheet
Worksheet where the data is found.
```yaml
@@ -179,6 +188,7 @@ Accept wildcard characters: False
```
### -SourceRange
Address range in the worksheet e.g "A10:F20" - the first row must be column names: if not specified the whole sheet will be used.
```yaml
@@ -194,6 +204,7 @@ Accept wildcard characters: False
```
### -PivotRows
Fields to set as rows in the PivotTable.
```yaml
@@ -209,6 +220,7 @@ Accept wildcard characters: False
```
### -PivotData
A hash table in form "FieldName"="Function", where function is one of Average, Count, CountNums, Max, Min, Product, None, StdDev, StdDevP, Sum, Var, VarP.
```yaml
@@ -224,6 +236,7 @@ Accept wildcard characters: False
```
### -PivotColumns
Fields to set as columns in the PivotTable.
```yaml
@@ -239,6 +252,7 @@ Accept wildcard characters: False
```
### -PivotFilter
Fields to use to filter in the PivotTable.
```yaml
@@ -254,6 +268,7 @@ Accept wildcard characters: False
```
### -PivotDataToColumn
If there are multiple data items in a PivotTable, by default they are shown on separate rows; this switch makes them separate columns.
```yaml
@@ -269,7 +284,8 @@ Accept wildcard characters: False
```
### -PivotTotals
Define whether totals should be added to rows, columns neither, or both (the default is both).
Define whether totals should be added to rows, columns neither, or both \(the default is both\).
```yaml
Type: String
@@ -284,6 +300,7 @@ Accept wildcard characters: False
```
### -NoTotalsInPivot
Included for compatibility - equivalent to -PivotTotals "None".
```yaml
@@ -299,7 +316,8 @@ Accept wildcard characters: False
```
### -GroupDateRow
The name of a row field which should be grouped by parts of the date/time (ignored if GroupDateRow is not specified)
The name of a row field which should be grouped by parts of the date/time \(ignored if GroupDateRow is not specified\)
```yaml
Type: String
@@ -314,7 +332,8 @@ Accept wildcard characters: False
```
### -GroupDatePart
The Part(s) of the date to use in the grouping (ignored if GroupDateRow is not specified)
The Part\(s\) of the date to use in the grouping \(ignored if GroupDateRow is not specified\)
```yaml
Type: eDateGroupBy[]
@@ -330,7 +349,8 @@ Accept wildcard characters: False
```
### -GroupNumericRow
The name of a row field which should be grouped by Number (e.g. 0-99, 100-199, 200-299 )
The name of a row field which should be grouped by Number \(e.g. 0-99, 100-199, 200-299 \)
```yaml
Type: String
@@ -345,6 +365,7 @@ Accept wildcard characters: False
```
### -GroupNumericMin
The starting point for grouping
```yaml
@@ -360,6 +381,7 @@ Accept wildcard characters: False
```
### -GroupNumericMax
The endpoint for grouping
```yaml
@@ -375,6 +397,7 @@ Accept wildcard characters: False
```
### -GroupNumericInterval
The interval for grouping
```yaml
@@ -390,6 +413,7 @@ Accept wildcard characters: False
```
### -PivotNumberFormat
Number format to apply to the data cells in the PivotTable.
```yaml
@@ -405,6 +429,7 @@ Accept wildcard characters: False
```
### -PivotTableStyle
Apply a table style to the PivotTable.
```yaml
@@ -421,6 +446,7 @@ Accept wildcard characters: False
```
### -PivotChartDefinition
Use a chart definition instead of specifying chart settings one by one.
```yaml
@@ -436,6 +462,7 @@ Accept wildcard characters: False
```
### -IncludePivotChart
If specified, a chart will be included.
```yaml
@@ -451,6 +478,7 @@ Accept wildcard characters: False
```
### -ChartTitle
Optional title for the pivot chart, by default the title omitted.
```yaml
@@ -466,7 +494,8 @@ Accept wildcard characters: False
```
### -ChartHeight
Height of the chart in Pixels (400 by default).
Height of the chart in Pixels \(400 by default\).
```yaml
Type: Int32
@@ -481,7 +510,8 @@ Accept wildcard characters: False
```
### -ChartWidth
Width of the chart in Pixels (600 by default).
Width of the chart in Pixels \(600 by default\).
```yaml
Type: Int32
@@ -496,7 +526,8 @@ Accept wildcard characters: False
```
### -ChartRow
Cell position of the top left corner of the chart, there will be this number of rows above the top edge of the chart (default is 0, chart starts at top edge of row 1).
Cell position of the top left corner of the chart, there will be this number of rows above the top edge of the chart \(default is 0, chart starts at top edge of row 1\).
```yaml
Type: Int32
@@ -511,7 +542,8 @@ Accept wildcard characters: False
```
### -ChartColumn
Cell position of the top left corner of the chart, there will be this number of cells to the left of the chart (default is 4, chart starts at left edge of column E).
Cell position of the top left corner of the chart, there will be this number of cells to the left of the chart \(default is 4, chart starts at left edge of column E\).
```yaml
Type: Int32
@@ -526,6 +558,7 @@ Accept wildcard characters: False
```
### -ChartRowOffSetPixels
Vertical offset of the chart from the cell corner.
```yaml
@@ -541,6 +574,7 @@ Accept wildcard characters: False
```
### -ChartColumnOffSetPixels
Horizontal offset of the chart from the cell corner.
```yaml
@@ -556,6 +590,7 @@ Accept wildcard characters: False
```
### -ChartType
Type of chart; defaults to "Pie".
```yaml
@@ -572,6 +607,7 @@ Accept wildcard characters: False
```
### -NoLegend
If specified hides the chart legend.
```yaml
@@ -587,6 +623,7 @@ Accept wildcard characters: False
```
### -ShowCategory
If specified attaches the category to slices in a pie chart : not supported on all chart types, this may give errors if applied to an unsupported type.
```yaml
@@ -602,6 +639,7 @@ Accept wildcard characters: False
```
### -ShowPercent
If specified attaches percentages to slices in a pie chart.
```yaml
@@ -617,6 +655,7 @@ Accept wildcard characters: False
```
### -Activate
If there is already content in the workbook the sheet with the PivotTable will not be active UNLESS Activate is specified.
```yaml
@@ -632,6 +671,7 @@ Accept wildcard characters: False
```
### -PassThru
Return the PivotTable so it can be customized.
```yaml
@@ -647,13 +687,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.Table.PivotTable.ExcelPivotTable
## NOTES
## RELATED LINKS

View File

@@ -1,30 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Add-WorkSheet
## SYNOPSIS
Adds a worksheet to an existing workbook.
## SYNTAX
### Package
```
```text
Add-WorkSheet [-ExcelPackage] <ExcelPackage> [-WorksheetName <String>] [-ClearSheet] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-Activate] [-CopySource <ExcelWorksheet>] [-NoClobber] [<CommonParameters>]
```
### WorkBook
```
```text
Add-WorkSheet -ExcelWorkbook <ExcelWorkbook> [-WorksheetName <String>] [-ClearSheet] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-Activate] [-CopySource <ExcelWorksheet>] [-NoClobber] [<CommonParameters>]
```
## DESCRIPTION
If the named worksheet already exists, the -Clearsheet parameter decides whether it should be deleted and a new one returned,
or if not specified the existing sheet will be returned.
If the named worksheet already exists, the -Clearsheet parameter decides whether it should be deleted and a new one returned, or if not specified the existing sheet will be returned.
By default the sheet is created at the end of the work book, the -MoveXXXX switches allow the sheet to be \[re\]positioned at the start or before or after another sheet.
@@ -33,15 +36,16 @@ A new sheet will only be made the default sheet when excel opens if -Activate is
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $WorksheetActors = $ExcelPackage | Add-WorkSheet -WorkSheetname Actors
```
$ExcelPackage holds an Excel package object (returned by Open-ExcelPackage, or Export-Excel -passthru).
This command will add a sheet named 'Actors', or return the sheet if it exists, and the result is stored in $WorkSheetActors.
$ExcelPackage holds an Excel package object \(returned by Open-ExcelPackage, or Export-Excel -passthru\). This command will add a sheet named 'Actors', or return the sheet if it exists, and the result is stored in $WorkSheetActors.
### EXAMPLE 2
```
```text
PS\> $WorksheetActors = Add-WorkSheet -ExcelPackage $ExcelPackage -WorkSheetname "Actors" -ClearSheet -MoveToStart
```
@@ -52,7 +56,8 @@ If the 'Actors' sheet already exists it is deleted and re-created.
The new sheet will be created last in the workbook, and -MoveToStart Moves it to the start.
### EXAMPLE 3
```
```text
PS\> $null = Add-WorkSheet -ExcelWorkbook $wb -WorkSheetname $DestinationName -CopySource $sourceWs -Activate
```
@@ -63,6 +68,7 @@ Here the new copy of the data is made the active sheet when the workbook is open
## PARAMETERS
### -ExcelPackage
An object representing an Excel Package.
```yaml
@@ -78,6 +84,7 @@ Accept wildcard characters: False
```
### -ExcelWorkbook
An Excel Workbook to which the Worksheet will be added - a Package contains one Workbook, so you can use whichever fits at the time.
```yaml
@@ -93,6 +100,7 @@ Accept wildcard characters: False
```
### -WorksheetName
The name of the worksheet, 'Sheet1' by default.
```yaml
@@ -108,6 +116,7 @@ Accept wildcard characters: False
```
### -ClearSheet
If the worksheet already exists, by default it will returned, unless -ClearSheet is specified in which case it will be deleted and re-created.
```yaml
@@ -123,6 +132,7 @@ Accept wildcard characters: False
```
### -MoveToStart
If specified, the worksheet will be moved to the start of the workbook.
MoveToStart takes precedence over MoveToEnd, Movebefore and MoveAfter if more than one is specified.
@@ -140,9 +150,10 @@ Accept wildcard characters: False
```
### -MoveToEnd
If specified, the worksheet will be moved to the end of the workbook.
(This is the default position for newly created sheets, but it can be used to move existing sheets.)
\(This is the default position for newly created sheets, but it can be used to move existing sheets.\)
```yaml
Type: SwitchParameter
@@ -157,7 +168,8 @@ Accept wildcard characters: False
```
### -MoveBefore
If specified, the worksheet will be moved before the nominated one (which can be an index starting from 1, or a name).
If specified, the worksheet will be moved before the nominated one \(which can be an index starting from 1, or a name\).
MoveBefore takes precedence over MoveAfter if both are specified.
@@ -174,9 +186,10 @@ Accept wildcard characters: False
```
### -MoveAfter
If specified, the worksheet will be moved after the nominated one (which can be an index starting from 1, or a name or *).
If * is used, the worksheet names will be examined starting with the first one, and the sheet placed after the last sheet which comes before it alphabetically.
If specified, the worksheet will be moved after the nominated one \(which can be an index starting from 1, or a name or \*\).
If \* is used, the worksheet names will be examined starting with the first one, and the sheet placed after the last sheet which comes before it alphabetically.
```yaml
Type: Object
@@ -191,6 +204,7 @@ Accept wildcard characters: False
```
### -Activate
If there is already content in the workbook the new sheet will not be active UNLESS Activate is specified.
```yaml
@@ -206,6 +220,7 @@ Accept wildcard characters: False
```
### -CopySource
If worksheet is provided as a copy source the new worksheet will be a copy of it. The source can be in the same workbook, or in a different file.
```yaml
@@ -221,6 +236,7 @@ Accept wildcard characters: False
```
### -NoClobber
Ignored but retained for backwards compatibility.
```yaml
@@ -236,13 +252,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.ExcelWorksheet
## NOTES
## RELATED LINKS

View File

@@ -1,23 +1,25 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Close-ExcelPackage
## SYNOPSIS
Closes an Excel Package, saving, saving under a new name or abandoning changes and opening the file in Excel as required.
## SYNTAX
```
```text
Close-ExcelPackage [-ExcelPackage] <ExcelPackage> [-Show] [-NoSave] [[-SaveAs] <Object>] [[-Password] <String>] [-Calculate] [<CommonParameters>]
```
## DESCRIPTION
When working with an ExcelPackage object, the Workbook is held in memory and not saved until the .Save() method of the package is called.
When working with an ExcelPackage object, the Workbook is held in memory and not saved until the .Save\(\) method of the package is called.
Close-ExcelPackage saves and disposes of the Package object.
@@ -26,14 +28,16 @@ It can be called with -NoSave to abandon the file without saving, with a new "Sa
## EXAMPLES
### EXAMPLE 1
```
```text
Close-ExcelPackage -show $excel
```
$excel holds a package object, this saves the workbook and loads it into Excel.
### EXAMPLE 2
```
```text
Close-ExcelPackage -NoSave $excel
```
@@ -42,6 +46,7 @@ $excel holds a package object, this disposes of it without writing it to disk.
## PARAMETERS
### -ExcelPackage
Package to close.
```yaml
@@ -57,6 +62,7 @@ Accept wildcard characters: False
```
### -Show
Open the file in Excel.
```yaml
@@ -72,6 +78,7 @@ Accept wildcard characters: False
```
### -NoSave
Abandon the file without saving.
```yaml
@@ -87,7 +94,8 @@ Accept wildcard characters: False
```
### -SaveAs
Save file with a new name (ignored if -NoSave Specified).
Save file with a new name \(ignored if -NoSave Specified\).
```yaml
Type: Object
@@ -102,6 +110,7 @@ Accept wildcard characters: False
```
### -Password
Password to protect the file.
```yaml
@@ -117,6 +126,7 @@ Accept wildcard characters: False
```
### -Calculate
Attempt to recalculation the workbook before saving
```yaml
@@ -132,7 +142,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -141,3 +152,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,39 +1,43 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Compare-WorkSheet
## SYNOPSIS
Compares two worksheets and shows the differences.
## SYNTAX
### True (Default)
```
### True \(Default\)
```text
Compare-WorkSheet [-Referencefile] <Object> [-Differencefile] <Object> [-WorkSheetName <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Startrow <Int32>] [-AllDataBackgroundColor <Object>] [-BackgroundColor <Object>] [-TabColor <Object>] [-Key <Object>] [-FontColor <Object>] [-Show] [-GridView] [-PassThru] [-IncludeEqual] [-ExcludeDifferent] [<CommonParameters>]
```
### B
```
```text
Compare-WorkSheet [-Referencefile] <Object> [-Differencefile] <Object> [-WorkSheetName <Object>] [-Property <Object>] [-ExcludeProperty <Object>] -Headername <String[]> [-Startrow <Int32>] [-AllDataBackgroundColor <Object>] [-BackgroundColor <Object>] [-TabColor <Object>] [-Key <Object>] [-FontColor <Object>] [-Show] [-GridView] [-PassThru] [-IncludeEqual] [-ExcludeDifferent] [<CommonParameters>]
```
### C
```
```text
Compare-WorkSheet [-Referencefile] <Object> [-Differencefile] <Object> [-WorkSheetName <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-NoHeader] [-Startrow <Int32>] [-AllDataBackgroundColor <Object>] [-BackgroundColor <Object>] [-TabColor <Object>] [-Key <Object>] [-FontColor <Object>] [-Show] [-GridView] [-PassThru] [-IncludeEqual] [-ExcludeDifferent] [<CommonParameters>]
```
## DESCRIPTION
This command takes two file names, one or two worksheet names and a name for a "key" column.
It reads the worksheet from each file and decides the column names and builds a hashtable of the key-column values and the
rows in which they appear.
It reads the worksheet from each file and decides the column names and builds a hashtable of the key-column values and the rows in which they appear.
It then uses PowerShell's Compare-Object command to compare the sheets (explicitly checking all the column names which have not been excluded).
It then uses PowerShell's Compare-Object command to compare the sheets \(explicitly checking all the column names which have not been excluded\).
For the difference rows it adds the row number for the key of that row - we have to add the key after doing the comparison, otherwise identical rows at different positions in the file will not be considered a match.
@@ -44,45 +48,50 @@ If -BackgroundColor is specified the difference rows will be changed to that bac
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Compare-WorkSheet -Referencefile 'Server56.xlsx' -Differencefile 'Server57.xlsx' -WorkSheetName Products -key IdentifyingNumber -ExcludeProperty Install* | Format-Table
```
The two workbooks in this example contain the result of redirecting a subset of properties from Get-WmiObject -Class win32_product to Export-Excel.
The two workbooks in this example contain the result of redirecting a subset of properties from Get-WmiObject -Class win32\_product to Export-Excel.
The command compares the "Products" pages in the two workbooks, but we don't want to register a difference if the software was installed on a different date or from a different place, and excluding Install* removes InstallDate and InstallSource.
The command compares the "Products" pages in the two workbooks, but we don't want to register a difference if the software was installed on a different date or from a different place, and excluding Install\* removes InstallDate and InstallSource.
This data doesn't have a "Name" column, so we specify the "IdentifyingNumber" column as the key.
The results will be presented as a table.
### EXAMPLE 2
```
```text
PS\> Compare-WorkSheet "Server54.xlsx" "Server55.xlsx" -WorkSheetName Services -GridView
```
This time two workbooks contain the result of redirecting the command Get-WmiObject -Class win32_service to Export-Excel.
This time two workbooks contain the result of redirecting the command Get-WmiObject -Class win32\_service to Export-Excel.
Here the -Differencefile and -Referencefile parameter switches are assumed and the default setting for -Key ("Name") works for services.
Here the -Differencefile and -Referencefile parameter switches are assumed and the default setting for -Key \("Name"\) works for services.
This will display the differences between the "Services" sheets using a grid view
### EXAMPLE 3
```
```text
PS\> Compare-WorkSheet 'Server54.xlsx' 'Server55.xlsx' -WorkSheetName Services -BackgroundColor lightGreen
```
This version of the command outputs the differences between the "services" pages and highlights any different rows in the spreadsheet files.
### EXAMPLE 4
```
```text
PS\> Compare-WorkSheet 'Server54.xlsx' 'Server55.xlsx' -WorkSheetName Services -BackgroundColor lightGreen -FontColor Red -Show
```
This example builds on the previous one: this time where two changed rows have the value in the "Name" column (the default value for -Key), this version adds highlighting of the changed cells in red; and then opens the Excel file.
This example builds on the previous one: this time where two changed rows have the value in the "Name" column \(the default value for -Key\), this version adds highlighting of the changed cells in red; and then opens the Excel file.
### EXAMPLE 5
```
```text
PS\> Compare-WorkSheet 'Pester-tests.xlsx' 'Pester-tests.xlsx' -WorkSheetName 'Server1','Server2' -Property "full Description","Executed","Result" -Key "full Description"
```
@@ -91,7 +100,8 @@ This time the reference file and the difference file are the same file and two d
Because the tests include the machine name and time the test was run, the command specifies that a limited set of columns should be used.
### EXAMPLE 6
```
```text
PS\> Compare-WorkSheet 'Server54.xlsx' 'Server55.xlsx' -WorkSheetName general -Startrow 2 -Headername Label,value -Key Label -GridView -ExcludeDifferent
```
@@ -104,7 +114,8 @@ This time we are interested in those rows which are the same in both sheets, and
Note that grid view works best when the number of columns is small.
### EXAMPLE 7
```
```text
PS\>Compare-WorkSheet 'Server1.xlsx' 'Server2.xlsx' -WorkSheetName general -Startrow 2 -Headername Label,value -Key Label -BackgroundColor White -Show -AllDataBackgroundColor LightGray
```
@@ -115,6 +126,7 @@ Only the unchanged rows are highlighted.
## PARAMETERS
### -Referencefile
First file to compare.
```yaml
@@ -130,6 +142,7 @@ Accept wildcard characters: False
```
### -Differencefile
Second file to compare.
```yaml
@@ -145,7 +158,8 @@ Accept wildcard characters: False
```
### -WorkSheetName
Name(s) of worksheets to compare.
Name\(s\) of worksheets to compare.
```yaml
Type: Object
@@ -160,7 +174,8 @@ Accept wildcard characters: False
```
### -Property
Properties to include in the comparison - supports wildcards, default is "*".
Properties to include in the comparison - supports wildcards, default is "\*".
```yaml
Type: Object
@@ -175,6 +190,7 @@ Accept wildcard characters: False
```
### -ExcludeProperty
Properties to exclude from the comparison - supports wildcards.
```yaml
@@ -190,6 +206,7 @@ Accept wildcard characters: False
```
### -Headername
Specifies custom property names to use, instead of the values defined in the starting row of the sheet.
```yaml
@@ -205,7 +222,8 @@ Accept wildcard characters: False
```
### -NoHeader
Automatically generate property names (P1, P2, P3 ...) instead of the using the values the starting row of the sheet.
Automatically generate property names \(P1, P2, P3 ...\) instead of the using the values the starting row of the sheet.
```yaml
Type: SwitchParameter
@@ -220,6 +238,7 @@ Accept wildcard characters: False
```
### -Startrow
The row from where we start to import data: all rows above the start row are disregarded. By default, this is the first row.
```yaml
@@ -235,6 +254,7 @@ Accept wildcard characters: False
```
### -AllDataBackgroundColor
If specified, highlights all the cells - so you can make Equal cells one color, and Different cells another.
```yaml
@@ -250,6 +270,7 @@ Accept wildcard characters: False
```
### -BackgroundColor
If specified, highlights the rows with differences.
```yaml
@@ -265,7 +286,8 @@ Accept wildcard characters: False
```
### -TabColor
If specified identifies the tabs which contain difference rows (ignored if -BackgroundColor is omitted).
If specified identifies the tabs which contain difference rows \(ignored if -BackgroundColor is omitted\).
```yaml
Type: Object
@@ -280,6 +302,7 @@ Accept wildcard characters: False
```
### -Key
Name of a column which is unique and will be used to add a row to the DIFF object, defaults to "Name".
```yaml
@@ -295,6 +318,7 @@ Accept wildcard characters: False
```
### -FontColor
If specified, highlights the DIFF columns in rows which have the same key.
```yaml
@@ -310,7 +334,8 @@ Accept wildcard characters: False
```
### -Show
If specified, opens the Excel workbooks instead of outputting the diff to the console (unless -PassThru is also specified).
If specified, opens the Excel workbooks instead of outputting the diff to the console \(unless -PassThru is also specified\).
```yaml
Type: SwitchParameter
@@ -325,8 +350,8 @@ Accept wildcard characters: False
```
### -GridView
If specified, the command tries to the show the DIFF in a Grid-View and not on the console (unless-PassThru is also specified).
This works best with few columns selected, and requires a key.
If specified, the command tries to the show the DIFF in a Grid-View and not on the console \(unless-PassThru is also specified\). This works best with few columns selected, and requires a key.
```yaml
Type: SwitchParameter
@@ -341,6 +366,7 @@ Accept wildcard characters: False
```
### -PassThru
If specified a full set of DIFF data is returned without filtering to the specified properties.
```yaml
@@ -356,6 +382,7 @@ Accept wildcard characters: False
```
### -IncludeEqual
If specified the result will include equal rows as well. By default only different rows are returned.
```yaml
@@ -371,6 +398,7 @@ Accept wildcard characters: False
```
### -ExcludeDifferent
If specified, the result includes only the rows where both are equal.
```yaml
@@ -386,7 +414,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -395,3 +424,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,36 +1,41 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Convert-ExcelRangeToImage
## SYNOPSIS
Gets the specified part of an Excel file and exports it as an image
## SYNTAX
```
```text
Convert-ExcelRangeToImage [-Path] <Object> [[-workSheetname] <Object>] [-range] <Object> [[-destination] <Object>] [-show] [<CommonParameters>]
```
## DESCRIPTION
Excel allows charts to be exported directly to a file, but it can't do this with the rest of a sheet. To work round this, this function
* Opens a copy of Excel and loads a file
* Selects a worksheet and then a range of cells in that worksheet
* Copies the select to the clipboard
* Saves the clipboard contents as an image file (it will save as .JPG unless the file name ends .BMP or .PNG)
* Copies a single cell to the clipboard (to prevent the "you have put a lot in the clipboard" message appearing)
* Saves the clipboard contents as an image file \(it will save as .JPG unless the file name ends .BMP or .PNG\)
* Copies a single cell to the clipboard \(to prevent the "you have put a lot in the clipboard" message appearing\)
* Closes Excel
Unlike most functions in the module it needs a local copy of Excel to be installed.
## EXAMPLES
Unlike most functions in the module it needs a local copy of Excel to be installed.
**EXAMPLES**
## PARAMETERS
### -Path
Path to the Excel file
```yaml
@@ -46,6 +51,7 @@ Accept wildcard characters: False
```
### -WorkSheetname
Worksheet name - if none is specified "Sheet1" will be assumed
```yaml
@@ -61,6 +67,7 @@ Accept wildcard characters: False
```
### -Range
Range of cells within the sheet, e.g "A1:Z99"
```yaml
@@ -76,6 +83,7 @@ Accept wildcard characters: False
```
### -Destination
A bmp, png or jpg file where the result will be saved
```yaml
@@ -91,6 +99,7 @@ Accept wildcard characters: False
```
### -Show
If specified opens the image in the default viewer.
```yaml
@@ -106,7 +115,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -115,3 +125,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,52 +1,50 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# ConvertFrom-ExcelSheet
## SYNOPSIS
Exports Sheets from Excel Workbooks to CSV files.
## SYNTAX
```
```text
ConvertFrom-ExcelSheet [-Path] <String> [[-OutputPath] <String>] [[-SheetName] <String>] [[-Encoding] <Encoding>]
[[-Extension] <String>] [[-Delimiter] <String>] [[-Property] <Object>] [[-ExcludeProperty] <Object>] [-Append]
[[-AsText] <String[]>] [<CommonParameters>]
```
## DESCRIPTION
This command provides a convenient way to run Import-Excel @ImportParameters | Select-Object @selectParameters | export-Csv @ ExportParameters
It can take the parameters -AsText , as used in Import-Excel, )Properties & -ExcludeProperties as used in Select-Object and
-Append, -Delimiter and -Encoding as used in Export-CSV
This command provides a convenient way to run Import-Excel @ImportParameters \| Select-Object @selectParameters \| export-Csv @ ExportParameters It can take the parameters -AsText , as used in Import-Excel, \)Properties & -ExcludeProperties as used in Select-Object and -Append, -Delimiter and -Encoding as used in Export-CSV
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> ConvertFrom-ExcelSheet Path .\__tests__\First10Races.xlsx -OutputPath .. -AsText GridPosition,date
```
First10Races.xlsx contains information about Motor races. The race date and grid (starting) position are stored with custom formats.
The command specifies the path to the file, and the directory to create the output file, and specifies that the columns "GridPosition" and "Date" should be treated as text to preserve their formatting
First10Races.xlsx contains information about Motor races. The race date and grid \(starting\) position are stored with custom formats. The command specifies the path to the file, and the directory to create the output file, and specifies that the columns "GridPosition" and "Date" should be treated as text to preserve their formatting
### Example 2
```powershell
```text
PS C:\> ConvertFrom-ExcelSheet Path .\__tests__\First10Races.xlsx -OutputPath .. -AsText "GridPosition" -Property driver, @{n="date"; e={[datetime]::FromOADate($_.Date).tostring("#MM/dd/yyyy#")}} , FinishPosition, GridPosition
```
This uses the same file as example 1. Because the race date has a custom format, it imports as a number,
The requirement is to create a CSV file with the Driver, a specially formatted Date, FinishPostion and GridPostion (keeping its custom formatting).
The command specifies the path to the file, and the directory to create the output file, specifies that the column "GridPosition" should be treated as text instead of a number, and the output properties should be Driver, a calculated "date" field, FinishPosition and GridPsition. FromOADate converts the dates used by Excel (Days since Jan 1 1900) to a datetime object.
This uses the same file as example 1. Because the race date has a custom format, it imports as a number, The requirement is to create a CSV file with the Driver, a specially formatted Date, FinishPostion and GridPostion \(keeping its custom formatting\). The command specifies the path to the file, and the directory to create the output file, specifies that the column "GridPosition" should be treated as text instead of a number, and the output properties should be Driver, a calculated "date" field, FinishPosition and GridPsition. FromOADate converts the dates used by Excel \(Days since Jan 1 1900\) to a datetime object.
## PARAMETERS
### -Append
Use this parameter to have the export add output to the end of the file. Without this parameter, the command replaces the file contents without warning.
```yaml
@@ -62,7 +60,8 @@ Accept wildcard characters: False
```
### -AsText
AsText allows selected columns to be returned as the text displayed in their cells, instead of their value. (* is supported as a wildcard.)
AsText allows selected columns to be returned as the text displayed in their cells, instead of their value. \(\* is supported as a wildcard.\)
```yaml
Type: String[]
@@ -77,7 +76,8 @@ Accept wildcard characters: False
```
### -AsDate
Not all date formats are recognized as indicating the number in the cell represents a date AsDate forces the number which would be returned to be converted to a date. (* is supported as a wildcard.)
Not all date formats are recognized as indicating the number in the cell represents a date AsDate forces the number which would be returned to be converted to a date. \(\* is supported as a wildcard.\)
```yaml
Type: String[]
@@ -92,6 +92,7 @@ Accept wildcard characters: False
```
### -Delimiter
Selects , or ; as the delimeter for the exported data - if not specified , is used by default.
```yaml
@@ -108,8 +109,8 @@ Accept wildcard characters: False
```
### -Encoding
Sets the text encoding for the output data file; UTF8 bu default
Sets the text encoding for the output data file; UTF8 bu default
```yaml
Type: Encoding
@@ -124,8 +125,8 @@ Accept wildcard characters: False
```
### -ExcludeProperty
Specifies the properties that to exclude from the export. Wildcards are permitted. This parameter is effective only when the command also includes the Property parameter.
Specifies the properties that to exclude from the export. Wildcards are permitted. This parameter is effective only when the command also includes the Property parameter.
```yaml
Type: Object
@@ -140,8 +141,8 @@ Accept wildcard characters: False
```
### -Extension
Sets the file extension for the exported data, defaults to CSV
Sets the file extension for the exported data, defaults to CSV
```yaml
Type: String
@@ -157,7 +158,8 @@ Accept wildcard characters: False
```
### -OutputPath
The directory where the output file(s) will be created. The file name(s) will match the name of the workbook page which contained the data.
The directory where the output file\(s\) will be created. The file name\(s\) will match the name of the workbook page which contained the data.
```yaml
Type: String
@@ -172,6 +174,7 @@ Accept wildcard characters: False
```
### -Path
The path to the .XLSX file which will be exported.
```yaml
@@ -187,8 +190,8 @@ Accept wildcard characters: False
```
### -Property
Specifies the properties to select. Wildcards are permitted - the default is "*".
The value of the Property parameter can be a new calculated property, and follows the same pattern as Select-Item
Specifies the properties to select. Wildcards are permitted - the default is "\*". The value of the Property parameter can be a new calculated property, and follows the same pattern as Select-Item
```yaml
Type: Object
@@ -203,6 +206,7 @@ Accept wildcard characters: False
```
### -SheetName
The name of a sheet to export, or a regular expression which is used to identify sheets
```yaml
@@ -218,7 +222,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -227,6 +232,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,28 +1,31 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# ConvertFrom-ExcelToSQLInsert
## SYNOPSIS
Generate SQL insert statements from Excel spreadsheet.
## SYNTAX
```
```text
ConvertFrom-ExcelToSQLInsert [-TableName] <Object> [-Path] <Object> [[-WorkSheetname] <Object>] [[-StartRow] <Int32>] [[-Header] <String[]>] [-NoHeader] [-DataOnly] [-ConvertEmptyStringsToNull] [-UseMSSQLSyntax] [<CommonParameters>]
```
## DESCRIPTION
Generate SQL insert statements from Excel spreadsheet.
## EXAMPLES
### EXAMPLE 1
```
```text
Generate SQL insert statements from Movies.xlsx file, leaving blank cells as empty strings:
----------------------------------------------------------
@@ -44,7 +47,8 @@ INSERT INTO Movies ('Movie Name', 'Year', 'Rating') Values('The Avengers', '2012
```
### EXAMPLE 2
```
```text
Generate SQL insert statements from Movies.xlsx file, specify NULL instead of an empty string.
----------------------------------------------------------
@@ -68,6 +72,7 @@ INSERT INTO Movies ('Movie Name', 'Year', 'Rating') Values('The Avengers', '2012
## PARAMETERS
### -TableName
Name of the target database table.
```yaml
@@ -83,8 +88,8 @@ Accept wildcard characters: False
```
### -Path
Path to an existing .XLSX file
This parameter is passed to Import-Excel as is.
Path to an existing .XLSX file This parameter is passed to Import-Excel as is.
```yaml
Type: Object
@@ -99,9 +104,8 @@ Accept wildcard characters: False
```
### -WorkSheetname
Specifies the name of the worksheet in the Excel workbook to import.
By default, if no name is provided, the first worksheet will be imported.
This parameter is passed to Import-Excel as is.
Specifies the name of the worksheet in the Excel workbook to import. By default, if no name is provided, the first worksheet will be imported. This parameter is passed to Import-Excel as is.
```yaml
Type: Object
@@ -116,10 +120,8 @@ Accept wildcard characters: False
```
### -StartRow
The row from where we start to import data, all rows above the StartRow are disregarded.
By default this is the first row.
When the parameters '-NoHeader' and '-HeaderName' are not provided, this row will contain the column headers that will be used as property names.
When one of both parameters are provided, the property names are automatically created and this row will be treated as a regular row containing data.
The row from where we start to import data, all rows above the StartRow are disregarded. By default this is the first row. When the parameters '-NoHeader' and '-HeaderName' are not provided, this row will contain the column headers that will be used as property names. When one of both parameters are provided, the property names are automatically created and this row will be treated as a regular row containing data.
```yaml
Type: Int32
@@ -134,10 +136,8 @@ Accept wildcard characters: False
```
### -Header
Specifies custom property names to use, instead of the values defined in the column headers of the TopRow.
If you provide fewr header names than there is data in the worksheet, then only the data with a corresponding header name will be imported and the data without header name will be disregarded.
If you provide more header names than there is data in the worksheet, then all data will be imported and all objects will have all the property names you defined in the header names.
As such, the last properties will be blank as there is no data for them.
Specifies custom property names to use, instead of the values defined in the column headers of the TopRow. If you provide fewr header names than there is data in the worksheet, then only the data with a corresponding header name will be imported and the data without header name will be disregarded. If you provide more header names than there is data in the worksheet, then all data will be imported and all objects will have all the property names you defined in the header names. As such, the last properties will be blank as there is no data for them.
```yaml
Type: String[]
@@ -152,8 +152,8 @@ Accept wildcard characters: False
```
### -NoHeader
Automatically generate property names (P1, P2, P3, ..) instead of the ones defined in the column headers of the TopRow.
This switch is best used when you want to import the complete worksheet 'as is' and are not concerned with the property names.
Automatically generate property names \(P1, P2, P3, ..\) instead of the ones defined in the column headers of the TopRow. This switch is best used when you want to import the complete worksheet 'as is' and are not concerned with the property names.
```yaml
Type: SwitchParameter
@@ -168,6 +168,7 @@ Accept wildcard characters: False
```
### -DataOnly
Import only rows and columns that contain data, empty rows and empty columns are not imported.
```yaml
@@ -183,8 +184,8 @@ Accept wildcard characters: False
```
### -ConvertEmptyStringsToNull
If specified, cells without any data are replaced with NULL, instead of an empty string.
This is to address behviors in certain DBMS where an empty string is insert as 0 for INT column, instead of a NULL value.
If specified, cells without any data are replaced with NULL, instead of an empty string. This is to address behviors in certain DBMS where an empty string is insert as 0 for INT column, instead of a NULL value.
```yaml
Type: SwitchParameter
@@ -199,7 +200,6 @@ Accept wildcard characters: False
```
### -UseMSSQLSyntax
{{ Fill UseMSSQLSyntax Description }}
```yaml
Type: SwitchParameter
@@ -214,7 +214,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -223,3 +224,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,68 +1,65 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Copy-ExcelWorkSheet
## SYNOPSIS
Copies a worksheet between workbooks or within the same workbook.
## SYNTAX
```
```text
Copy-ExcelWorkSheet [-SourceObject] <Object> [[-SourceWorkSheet] <Object>] [-DestinationWorkbook] <Object>
[[-DestinationWorksheet] <Object>] [-Show] [<CommonParameters>]
```
## DESCRIPTION
Copy-ExcelWorkSheet takes a Source object which is either a worksheet,
or a package, Workbook or path, in which case the source worksheet can be specified
by name or number (starting from 1).
The destination worksheet can be explicitly named, or will follow the name of the source if no name is specified.
The Destination workbook can be given as the path to an XLSx file, an ExcelPackage object or an ExcelWorkbook object.
Copy-ExcelWorkSheet takes a Source object which is either a worksheet, or a package, Workbook or path, in which case the source worksheet can be specified by name or number \(starting from 1\). The destination worksheet can be explicitly named, or will follow the name of the source if no name is specified. The Destination workbook can be given as the path to an XLSx file, an ExcelPackage object or an ExcelWorkbook object.
## EXAMPLES
### EXAMPLE 1
```
```text
Copy-ExcelWorkSheet -SourceWorkbook Test1.xlsx -DestinationWorkbook Test2.xlsx
```
This is the simplest version of the command: no source worksheet is specified so Copy-ExcelWorksheet uses the first sheet in the workbook
No Destination sheet is specified so the new worksheet will be the same as the one which is being copied.
This is the simplest version of the command: no source worksheet is specified so Copy-ExcelWorksheet uses the first sheet in the workbook No Destination sheet is specified so the new worksheet will be the same as the one which is being copied.
### EXAMPLE 2
```
```text
Copy-ExcelWorkSheet -SourceWorkbook Server1.xlsx -sourceWorksheet "Settings" -DestinationWorkbook Settings.xlsx -DestinationWorksheet "Server1"
```
Here the Settings page from Server1's workbook is copied to the 'Server1" page of a "Settings" workbook.
### EXAMPLE 3
```
```text
$excel = Open-ExcelPackage .\test.xlsx
```
C:\\\> Copy-ExcelWorkSheet -SourceWorkbook $excel -SourceWorkSheet "first" -DestinationWorkbook $excel -Show -DestinationWorksheet Duplicate
This opens the workbook test.xlsx and copies the worksheet named "first" to a new worksheet named "Duplicate",
because -Show is specified the file is saved and opened in Excel
C:\&gt; Copy-ExcelWorkSheet -SourceWorkbook $excel -SourceWorkSheet "first" -DestinationWorkbook $excel -Show -DestinationWorksheet Duplicate This opens the workbook test.xlsx and copies the worksheet named "first" to a new worksheet named "Duplicate", because -Show is specified the file is saved and opened in Excel
### EXAMPLE 4
```
```text
$excel = Open-ExcelPackage .\test.xlsx
```
C:\\\> Copy-ExcelWorkSheet -SourceWorkbook $excel -SourceWorkSheet 1 -DestinationWorkbook $excel -DestinationWorksheet Duplicate
C:\\\> Close-ExcelPackage $excel
This is almost the same as the previous example, except source sheet is specified by position rather than name and
because -Show is not specified, so other steps can be carried using the package object, at the end the file is saved by Close-ExcelPackage
C:\&gt; Copy-ExcelWorkSheet -SourceWorkbook $excel -SourceWorkSheet 1 -DestinationWorkbook $excel -DestinationWorksheet Duplicate C:\&gt; Close-ExcelPackage $excel This is almost the same as the previous example, except source sheet is specified by position rather than name and because -Show is not specified, so other steps can be carried using the package object, at the end the file is saved by Close-ExcelPackage
## PARAMETERS
### -SourceObject
An ExcelWorkbook or ExcelPackage object or the path to an XLSx file where the data is found.
```yaml
@@ -78,7 +75,8 @@ Accept wildcard characters: False
```
### -SourceWorkSheet
Name or number (starting from 1) of the worksheet in the source workbook (defaults to 1).
Name or number \(starting from 1\) of the worksheet in the source workbook \(defaults to 1\).
```yaml
Type: Object
@@ -93,6 +91,7 @@ Accept wildcard characters: False
```
### -DestinationWorkbook
An ExcelWorkbook or ExcelPackage object or the path to an XLSx file where the data should be copied.
```yaml
@@ -108,8 +107,8 @@ Accept wildcard characters: False
```
### -DestinationWorksheet
Name of the worksheet in the destination workbook; by default the same as the source worksheet's name.
If the sheet exists it will be deleted and re-copied.
Name of the worksheet in the destination workbook; by default the same as the source worksheet's name. If the sheet exists it will be deleted and re-copied.
```yaml
Type: Object
@@ -124,6 +123,7 @@ Accept wildcard characters: False
```
### -Show
if the destination is an excel package or a path, launch excel and open the file on completion.
```yaml
@@ -139,7 +139,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -148,3 +149,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,48 +1,54 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Expand-NumberFormat
## SYNOPSIS
Converts short names for number formats to the formatting strings used in Excel
## SYNTAX
```
```text
Expand-NumberFormat [[-NumberFormat] <Object>] [<CommonParameters>]
```
## DESCRIPTION
Where you can type a number format you can write, for example, 'Short-Date' and the module will translate it into the format string used by Excel. Some formats, like Short-Date, change when Excel loads (so date will use the local ordering of year, month and Day). Excel also changes how markers in the are presented different cultures "," is used in the format string to mean "local thousand seperator" but depending on the country "," or "." or " " may used as the thousand seperator.
Where you can type a number format you can write, for example, 'Short-Date' and the module will translate it into the format string used by Excel. Some formats, like Short-Date, change when Excel loads \(so date will use the local ordering of year, month and Day\). Excel also changes how markers in the are presented different cultures "," is used in the format string to mean "local thousand seperator" but depending on the country "," or "." or " " may used as the thousand seperator.
## EXAMPLES
### EXAMPLE 1
```
```text
Expand-NumberFormat percentage
```
Returns "0.00%"
### EXAMPLE 2
```
```text
Expand-NumberFormat Currency
```
Returns the currency format specified in the local regional settings, which may not be the same as Excel uses.
The regional settings set the currency symbol and then whether it is before or after the number and separated with a space or not; for negative numbers the number may be wrapped in parentheses or a - sign might appear before or after the number and symbol.
So this returns $#,##0.00;($#,##0.00) for English US, #,##0.00 €;€#,##0.00- for French.
So this returns $\#,\#\#0.00;\($\#,\#\#0.00\) for English US, \#,\#\#0.00 €;€\#,\#\#0.00- for French.
Note some Eurozone countries write €1,23 and others 1,23€. In French the decimal point will be rendered as a "," and the thousand
separator as a space.
Note some Eurozone countries write €1,23 and others 1,23€. In French the decimal point will be rendered as a "," and the thousand separator as a space.
## PARAMETERS
### -NumberFormat
The format string to Expand
```yaml
@@ -58,13 +64,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### System.String
## NOTES
## RELATED LINKS

View File

@@ -1,43 +1,48 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Export-Excel
## SYNOPSIS
Exports data to an Excel worksheet.
## SYNTAX
### Default (Default)
```
### Default \(Default\)
```text
Export-Excel [[-Path] <String>] [-InputObject <Object>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>] [-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBold] [-TitleSize <Int32>] [-TitleBackgroundColor <Object>][-IncludePivotTable] [-PivotTableName <String>] [-PivotRows <String[]> [-PivotColumns <String[]>] [-PivotData <Object>] [-PivotFilter <String[]>] [-PivotDataToColumn] [-PivotTableDefinition <Hashtable>] [-IncludePivotChart] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-AutoSize] [-MaxAutoSizeRows <Object>] [-NoClobber] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-NoHeader] [-RangeName <String>] [-TableName <Object>] [-TableStyle <TableStyles>] [-Barchart] [-PieChart] [-LineChart] [-ColumnChart] [-ExcelChartDefinition <Object[]>] [-HideSheet <String[]>] [-UnHideSheet <String[]>] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-KillExcel] [-AutoNameRange] [-StartRow <Int32>] [-StartColumn <Int32>] [-PassThru] [-Numberformat <String>] [-ExcludeProperty <String[]>] [-NoAliasOrScriptPropeties] [-DisplayPropertySet] [-NoNumberConversion <String[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-Style <Object[]>] [-CellStyleSB <ScriptBlock>] [-Activate] [-Now] [-ReturnRange] [-PivotTotals <String>] [-NoTotalsInPivot] [-ReZip] [<CommonParameters>]
```
### Package
```
```text
Export-Excel -ExcelPackage <ExcelPackage> [-InputObject <Object>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>] [-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBold] [-TitleSize <Int32>] [-TitleBackgroundColor <Object>] [-IncludePivotTable] [-PivotTableName <String>] [-PivotRows <String[]>] [-PivotColumns <String[]>] [-PivotData <Object>] [-PivotFilter <String[]>] [-PivotDataToColumn] [-PivotTableDefinition <Hashtable>] [-IncludePivotChart] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-AutoSize] [-MaxAutoSizeRows <Object>] [-NoClobber] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-NoHeader] [-RangeName <String>] [-TableName <Object>] [-TableStyle <TableStyles>] [-Barchart] [-PieChart] [-LineChart] [-ColumnChart] [-ExcelChartDefinition <Object[]>] [-HideSheet <String[]>] [-UnHideSheet <String[]>] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-KillExcel] [-AutoNameRange] [-StartRow <Int32>] [-StartColumn <Int32>] [-PassThru] [-Numberformat <String>] [-ExcludeProperty <String[]>]
[-NoAliasOrScriptPropeties] [-DisplayPropertySet] [-NoNumberConversion <String[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-Style <Object[]>] [-CellStyleSB <ScriptBlock>] [-Activate] [-ReturnRange] [-PivotTotals <String>] [-NoTotalsInPivot] [-ReZip] [<CommonParameters>]
```
## DESCRIPTION
Exports data to an Excel file and where possible tries to convert numbers in text fields so Excel recognizes them as numbers instead of text. After all: Excel is a spreadsheet program used for number manipulation and calculations.
The parameter -NoNumberConversion * can be used if number conversion is not desired.
Exports data to an Excel file and where possible tries to convert numbers in text fields so Excel recognizes them as numbers instead of text. After all: Excel is a spreadsheet program used for number manipulation and calculations. The parameter -NoNumberConversion \* can be used if number conversion is not desired.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Get-Process | Export-Excel .\Test.xlsx -show
```
Export all the processes to the Excel file 'Test.xlsx' and open the file immediately.
### EXAMPLE 2
```
```text
PS\> $ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -53,7 +58,8 @@ Exports all data to the Excel file 'Excel.xslx' and colors the negative values i
It will also add a dollar sign in front of the numbers which use a thousand seperator and display to two decimal places.
### EXAMPLE 3
```
```text
PS\> $ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -80,7 +86,8 @@ PS\> [PSCustOmobject][Ordered]@{
Exports all data to the Excel file "Excel.xlsx" and tries to convert all values to numbers where possible except for "IPAddress" and "Number1", which are stored in the sheet 'as is', without being converted to a number.
### EXAMPLE 4
```
```text
PS\> $ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -107,7 +114,8 @@ PS\> [PSCustOmobject][Ordered]@{
Exports all data to the Excel file 'Excel.xslx' as is, no number conversion will take place. This means that Excel will show the exact same data that you handed over to the 'Export-Excel' function.
### EXAMPLE 5
```
```text
PS\> $ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -125,7 +133,8 @@ Exports data that will have a Conditional Formatting rule in Excel that will sho
Where the condition is not met the color will be the default, black text on a white background.
### EXAMPLE 6
```
```text
PS\> $ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -146,7 +155,8 @@ If the value contains the word "Running" it will have a background fill color of
If neither condition is met, the color will be the default, black text on a white background.
### EXAMPLE 7
```
```text
PS\> $ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -180,22 +190,26 @@ PS\> $Array | Update-FirstObjectProperties | Export-Excel @ExcelParams -Workshee
Updates the first object of the array by adding property 'Member3' and 'Member4'. Afterwards, all objects are exported to an Excel file and all column headers are visible.
### EXAMPLE 8
```
```text
PS\> Get-Process | Export-Excel .\test.xlsx -WorksheetName Processes -IncludePivotTable -Show -PivotRows Company -PivotData PM
```
### EXAMPLE 9
```
```text
PS\> Get-Process | Export-Excel .\test.xlsx -WorksheetName Processes -ChartType PieExploded3D -IncludePivotChart -IncludePivotTable -Show -PivotRows Company -PivotData PM
```
### EXAMPLE 10
```
```text
PS\> Get-Service | Export-Excel 'c:\temp\test.xlsx' -Show -IncludePivotTable -PivotRows status -PivotData @{status='count'}
```
### EXAMPLE 11
```
```text
PS\> $pt = [ordered]@{}
PS\> $pt.pt1=@{
SourceWorkSheet = 'Sheet1';
@@ -224,7 +238,8 @@ Then it puts Service data on Sheet1 with one call to Export-Excel and Process Da
The third and final call adds the two PivotTables and opens the spreadsheet in Excel.
### EXAMPLE 12
```
```text
PS\> Remove-Item -Path .\test.xlsx
PS\> $excel = Get-Service | Select-Object -Property Status,Name,DisplayName,StartType | Export-Excel -Path .\test.xlsx -PassThru
PS\> $excel.Workbook.Worksheets ["Sheet1"].Row(1).style.font.bold = $true
@@ -244,7 +259,8 @@ It then uses the package object to apply formatting, and then saves the workbook
Note: Other commands in the module remove the need to work directly with the package object in this way.
### EXAMPLE 13
```
```text
PS\> Remove-Item -Path .\test.xlsx -ErrorAction Ignore
PS\> $excel = Get-Process | Select-Object -Property Name,Company,Handles,CPU,PM,NPM,WS |
Export-Excel -Path .\test.xlsx -ClearSheet -WorksheetName "Processes" -PassThru
@@ -266,15 +282,17 @@ This a more sophisticated version of the previous example showing different ways
In the final command a PivotChart is added and the workbook is opened in Excel.
### EXAMPLE 14
```
```text
PS\> 0..360 | ForEach-Object {[pscustomobject][ordered]@{X=$_; Sinx="=Sin(Radians(x)) "} } |
Export-Excel -now -LineChart -AutoNameRange
```
Creates a line chart showing the value of Sine(x) for values of X between 0 and 360 degrees.
Creates a line chart showing the value of Sine\(x\) for values of X between 0 and 360 degrees.
### EXAMPLE 15
```
```text
PS\> Invoke-Sqlcmd -ServerInstance localhost\DEFAULT -Database AdventureWorks2014 -Query "select * from sys.tables" -OutputAs DataRows |
Export-Excel -Path .\SysTables_AdventureWorks2014.xlsx -WorksheetName Tables
```
@@ -286,6 +304,7 @@ NOTE: You need to install the SqlServer module from the PowerShell Gallery in or
## PARAMETERS
### -Path
Path to a new or existing .XLSX file.
```yaml
@@ -301,6 +320,7 @@ Accept wildcard characters: False
```
### -ExcelPackage
An object representing an Excel Package - usually this is returned by specifying -PassThru allowing multiple commands to work on the same workbook without saving and reloading each time.
```yaml
@@ -316,6 +336,7 @@ Accept wildcard characters: False
```
### -InputObject
Date is usually piped into Export-Excel, but it also accepts data through the InputObject parameter
```yaml
@@ -331,6 +352,7 @@ Accept wildcard characters: False
```
### -Calculate
If specified, a recalculation of the worksheet will be requested before saving.
```yaml
@@ -346,6 +368,7 @@ Accept wildcard characters: False
```
### -Show
Opens the Excel file immediately after creation; convenient for viewing the results instantly without having to search for the file first.
```yaml
@@ -361,6 +384,7 @@ Accept wildcard characters: False
```
### -WorksheetName
The name of a sheet within the workbook - "Sheet1" by default.
```yaml
@@ -376,6 +400,7 @@ Accept wildcard characters: False
```
### -Password
Sets password protection on the workbook.
```yaml
@@ -391,9 +416,10 @@ Accept wildcard characters: False
```
### -ClearSheet
If specified Export-Excel will remove any existing worksheet with the selected name.
The default behaviour is to overwrite cells in this sheet as needed (but leaving non-overwritten ones in place).
The default behaviour is to overwrite cells in this sheet as needed \(but leaving non-overwritten ones in place\).
```yaml
Type: SwitchParameter
@@ -408,6 +434,7 @@ Accept wildcard characters: False
```
### -Append
If specified data will be added to the end of an existing sheet, using the same column headings.
```yaml
@@ -423,6 +450,7 @@ Accept wildcard characters: False
```
### -Title
Text of a title to be placed in the top left cell.
```yaml
@@ -438,6 +466,7 @@ Accept wildcard characters: False
```
### -TitleFillPattern
Sets the fill pattern for the title cell.
```yaml
@@ -454,6 +483,7 @@ Accept wildcard characters: False
```
### -TitleBold
Sets the title in boldface type.
```yaml
@@ -469,6 +499,7 @@ Accept wildcard characters: False
```
### -TitleSize
Sets the point size for the title.
```yaml
@@ -484,6 +515,7 @@ Accept wildcard characters: False
```
### -TitleBackgroundColor
Sets the cell background color for the title cell.
```yaml
@@ -499,6 +531,7 @@ Accept wildcard characters: False
```
### -IncludePivotTable
Adds a PivotTable using the data in the worksheet.
```yaml
@@ -514,6 +547,7 @@ Accept wildcard characters: False
```
### -PivotTableName
If a PivotTable is created from command line parameters, specifies the name of the new sheet holding the pivot. Defaults to "WorksheetName-PivotTable".
```yaml
@@ -529,7 +563,8 @@ Accept wildcard characters: False
```
### -PivotRows
Name(s) of column(s) from the spreadsheet which will provide the Row name(s) in a PivotTable created from command line parameters.
Name\(s\) of column\(s\) from the spreadsheet which will provide the Row name\(s\) in a PivotTable created from command line parameters.
```yaml
Type: String[]
@@ -544,7 +579,8 @@ Accept wildcard characters: False
```
### -PivotColumns
Name(s) of columns from the spreadsheet which will provide the Column name(s) in a PivotTable created from command line parameters.
Name\(s\) of columns from the spreadsheet which will provide the Column name\(s\) in a PivotTable created from command line parameters.
```yaml
Type: String[]
@@ -559,9 +595,10 @@ Accept wildcard characters: False
```
### -PivotData
In a PivotTable created from command line parameters, the fields to use in the table body are given as a Hash-table in the form
ColumnName = Average|Count|CountNums|Max|Min|Product|None|StdDev|StdDevP|Sum|Var|VarP.
ColumnName = Average\|Count\|CountNums\|Max\|Min\|Product\|None\|StdDev\|StdDevP\|Sum\|Var\|VarP.
```yaml
Type: Object
@@ -576,7 +613,8 @@ Accept wildcard characters: False
```
### -PivotFilter
Name(s) columns from the spreadsheet which will provide the Filter name(s) in a PivotTable created from command line parameters.
Name\(s\) columns from the spreadsheet which will provide the Filter name\(s\) in a PivotTable created from command line parameters.
```yaml
Type: String[]
@@ -591,6 +629,7 @@ Accept wildcard characters: False
```
### -PivotDataToColumn
If there are multiple datasets in a PivotTable, by default they are shown as separate rows under the given row heading; this switch makes them separate columns.
```yaml
@@ -606,6 +645,7 @@ Accept wildcard characters: False
```
### -PivotTableDefinition
Instead of describing a single PivotTable with multiple command-line parameters; you can use a HashTable in the form PivotTableName = Definition;
In this table Definition is itself a Hashtable with Sheet, PivotRows, PivotColumns, PivotData, IncludePivotChart and ChartType values. The New-PivotTableDefinition command will create the definition from a command line.
@@ -623,6 +663,7 @@ Accept wildcard characters: False
```
### -IncludePivotChart
Include a chart with the PivotTable - implies -IncludePivotTable.
```yaml
@@ -638,7 +679,8 @@ Accept wildcard characters: False
```
### -ChartType
The type for PivotChart (one of Excel's defined chart types).
The type for PivotChart \(one of Excel's defined chart types\).
```yaml
Type: eChartType
@@ -654,6 +696,7 @@ Accept wildcard characters: False
```
### -NoLegend
Exclude the legend from the PivotChart.
```yaml
@@ -669,6 +712,7 @@ Accept wildcard characters: False
```
### -ShowCategory
Add category labels to the PivotChart.
```yaml
@@ -684,6 +728,7 @@ Accept wildcard characters: False
```
### -ShowPercent
Add percentage labels to the PivotChart.
```yaml
@@ -699,6 +744,7 @@ Accept wildcard characters: False
```
### -AutoSize
Sizes the width of the Excel column to the maximum width needed to display all the containing data in that cell.
```yaml
@@ -714,6 +760,7 @@ Accept wildcard characters: False
```
### -MaxAutoSizeRows
Autosizing can be time consuming, so this sets a maximum number of rows to look at for the Autosize operation. Default is 1000; If 0 is specified ALL rows will be checked
```yaml
@@ -729,6 +776,7 @@ Accept wildcard characters: False
```
### -NoClobber
Not used. Left in to avoid problems with older scripts, it may be removed in future versions.
```yaml
@@ -744,6 +792,7 @@ Accept wildcard characters: False
```
### -FreezeTopRow
Freezes headers etc. in the top row.
```yaml
@@ -759,6 +808,7 @@ Accept wildcard characters: False
```
### -FreezeFirstColumn
Freezes titles etc. in the left column.
```yaml
@@ -774,7 +824,8 @@ Accept wildcard characters: False
```
### -FreezeTopRowFirstColumn
Freezes top row and left column (equivalent to Freeze pane 2,2 ).
Freezes top row and left column \(equivalent to Freeze pane 2,2 \).
```yaml
Type: SwitchParameter
@@ -789,7 +840,8 @@ Accept wildcard characters: False
```
### -FreezePane
Freezes panes at specified coordinates (in the form RowNumber, ColumnNumber).
Freezes panes at specified coordinates \(in the form RowNumber, ColumnNumber\).
```yaml
Type: Int32[]
@@ -804,6 +856,7 @@ Accept wildcard characters: False
```
### -AutoFilter
Enables the Excel filter on the complete header row, so users can easily sort, filter and/or search the data in the selected column.
```yaml
@@ -819,6 +872,7 @@ Accept wildcard characters: False
```
### -BoldTopRow
Makes the top row boldface.
```yaml
@@ -834,6 +888,7 @@ Accept wildcard characters: False
```
### -NoHeader
Specifies that field names should not be put at the top of columns.
```yaml
@@ -849,6 +904,7 @@ Accept wildcard characters: False
```
### -RangeName
Makes the data in the worksheet a named range.
```yaml
@@ -864,6 +920,7 @@ Accept wildcard characters: False
```
### -TableName
Makes the data in the worksheet a table with a name, and applies a style to it. The name must not contain spaces. If the -Tablestyle parameter is specified without Tablename, "table1", "table2" etc. will be used.
```yaml
@@ -879,6 +936,7 @@ Accept wildcard characters: False
```
### -TableStyle
Selects the style for the named table - if the Tablename parameter is specified without giving a style, 'Medium6' is used as a default.
```yaml
@@ -895,6 +953,7 @@ Accept wildcard characters: False
```
### -Barchart
Creates a "quick" bar chart using the first text column as labels and the first numeric column as values.
```yaml
@@ -910,6 +969,7 @@ Accept wildcard characters: False
```
### -PieChart
Creates a "quick" pie chart using the first text column as labels and the first numeric column as values.
```yaml
@@ -925,6 +985,7 @@ Accept wildcard characters: False
```
### -LineChart
Creates a "quick" line chart using the first text column as labels and the first numeric column as values.
```yaml
@@ -940,6 +1001,7 @@ Accept wildcard characters: False
```
### -ColumnChart
Creates a "quick" column chart using the first text column as labels and the first numeric column as values.
```yaml
@@ -955,6 +1017,7 @@ Accept wildcard characters: False
```
### -ExcelChartDefinition
A hash-table containing ChartType, Title, NoLegend, ShowCategory, ShowPercent, Yrange, Xrange and SeriesHeader for one or more \[non-Pivot\] charts. This can be created with the New-ExcelChartDefinition command.
```yaml
@@ -970,7 +1033,8 @@ Accept wildcard characters: False
```
### -HideSheet
Name(s) of Sheet(s) to hide in the workbook, supports wildcards. If the selection would cause all sheets to be hidden, the sheet being worked on will be revealed.
Name\(s\) of Sheet\(s\) to hide in the workbook, supports wildcards. If the selection would cause all sheets to be hidden, the sheet being worked on will be revealed.
```yaml
Type: String[]
@@ -985,7 +1049,8 @@ Accept wildcard characters: False
```
### -UnHideSheet
Name(s) of Sheet(s) to reveal in the workbook, supports wildcards.
Name\(s\) of Sheet\(s\) to reveal in the workbook, supports wildcards.
```yaml
Type: String[]
@@ -1000,6 +1065,7 @@ Accept wildcard characters: False
```
### -MoveToStart
If specified, the worksheet will be moved to the start of the workbook.
-MoveToStart takes precedence over -MoveToEnd, -Movebefore and -MoveAfter if more than one is specified.
@@ -1017,7 +1083,8 @@ Accept wildcard characters: False
```
### -MoveToEnd
If specified, the worksheet will be moved to the end of the workbook. (This is the default position for newly created sheets, but the option can be specified to move existing sheets.)
If specified, the worksheet will be moved to the end of the workbook. \(This is the default position for newly created sheets, but the option can be specified to move existing sheets.\)
```yaml
Type: SwitchParameter
@@ -1032,7 +1099,8 @@ Accept wildcard characters: False
```
### -MoveBefore
If specified, the worksheet will be moved before the nominated one (which can be a position starting from 1, or a name).
If specified, the worksheet will be moved before the nominated one \(which can be a position starting from 1, or a name\).
-MoveBefore takes precedence over -MoveAfter if both are specified.
@@ -1049,9 +1117,10 @@ Accept wildcard characters: False
```
### -MoveAfter
If specified, the worksheet will be moved after the nominated one (which can be a position starting from 1, or a name or *).
If * is used, the worksheet names will be examined starting with the first one, and the sheet placed after the last sheet which comes before it alphabetically.
If specified, the worksheet will be moved after the nominated one \(which can be a position starting from 1, or a name or \*\).
If \* is used, the worksheet names will be examined starting with the first one, and the sheet placed after the last sheet which comes before it alphabetically.
```yaml
Type: Object
@@ -1066,6 +1135,7 @@ Accept wildcard characters: False
```
### -KillExcel
Closes Excel without stopping to ask if work should be saved - prevents errors writing to the file because Excel has it open.
```yaml
@@ -1081,6 +1151,7 @@ Accept wildcard characters: False
```
### -AutoNameRange
Makes each column a named range.
```yaml
@@ -1096,8 +1167,8 @@ Accept wildcard characters: False
```
### -StartRow
Row to start adding data. 1 by default.
Row 1 will contain the title, if any is specifed. Then headers will appear (Unless -No header is specified) then the data appears.
Row to start adding data. 1 by default. Row 1 will contain the title, if any is specifed. Then headers will appear \(Unless -No header is specified\) then the data appears.
```yaml
Type: Int32
@@ -1112,6 +1183,7 @@ Accept wildcard characters: False
```
### -StartColumn
Column to start adding data - 1 by default.
```yaml
@@ -1127,8 +1199,8 @@ Accept wildcard characters: False
```
### -PassThru
If specified, Export-Excel returns an object representing the Excel package without saving the package first.
To save, you must either use the Close-ExcelPackage command, or send the package object back to Export-Excel which will save and close the file, or use the object's .Save() or SaveAs() method.
If specified, Export-Excel returns an object representing the Excel package without saving the package first. To save, you must either use the Close-ExcelPackage command, or send the package object back to Export-Excel which will save and close the file, or use the object's .Save\(\) or SaveAs\(\) method.
```yaml
Type: SwitchParameter
@@ -1143,8 +1215,10 @@ Accept wildcard characters: False
```
### -Numberformat
Formats all values that can be converted to a number to the format specified. For examples:
```
```text
'0' integer (not really needed unless you need to round numbers, Excel will use default cell properties).
'#' integer without displaying the number 0 in the cell.
'0.0' number with 1 decimal place.
@@ -1169,6 +1243,7 @@ Accept wildcard characters: False
```
### -ExcludeProperty
Specifies properties which may exist in the target data but should not be placed on the worksheet.
```yaml
@@ -1184,6 +1259,7 @@ Accept wildcard characters: False
```
### -NoAliasOrScriptPropeties
Some objects in PowerShell duplicate existing properties by adding aliases, or have Script properties which may take a long time to return a value and slow the export down, if specified this option removes these properties
```yaml
@@ -1199,7 +1275,8 @@ Accept wildcard characters: False
```
### -DisplayPropertySet
Many (but not all) objects in PowerShell have a hidden property named psStandardmembers with a child property DefaultDisplayPropertySet ; this parameter reduces the properties exported to those in this set.
Many \(but not all\) objects in PowerShell have a hidden property named psStandardmembers with a child property DefaultDisplayPropertySet ; this parameter reduces the properties exported to those in this set.
```yaml
Type: SwitchParameter
@@ -1214,9 +1291,10 @@ Accept wildcard characters: False
```
### -NoNumberConversion
By default the command will convert all values to numbers if possible, but this isn't always desirable. -NoNumberConversion allows you to add exceptions for the conversion.
The only Wildcard allowed is * for all properties
The only Wildcard allowed is \* for all properties
```yaml
Type: String[]
@@ -1231,6 +1309,7 @@ Accept wildcard characters: False
```
### -ConditionalFormat
One or more conditional formatting rules defined with New-ConditionalFormattingIconSet.
```yaml
@@ -1246,6 +1325,7 @@ Accept wildcard characters: False
```
### -ConditionalText
Applies a Conditional formatting rule defined with New-ConditionalText. When specific conditions are met the format is applied.
```yaml
@@ -1261,7 +1341,8 @@ Accept wildcard characters: False
```
### -Style
Takes style settings as a hash-table (which may be built with the New-ExcelStyle command) and applies them to the worksheet. If the hash-table contains a range the settings apply to the range, otherewise they apply to the whole sheet.
Takes style settings as a hash-table \(which may be built with the New-ExcelStyle command\) and applies them to the worksheet. If the hash-table contains a range the settings apply to the range, otherewise they apply to the whole sheet.
```yaml
Type: Object[]
@@ -1276,8 +1357,8 @@ Accept wildcard characters: False
```
### -CellStyleSB
A script block which is run at the end of the export to apply styles to cells (although it can be used for other purposes).
The script block is given three paramaters; an object containing the current worksheet, the Total number of Rows and the number of the last column.
A script block which is run at the end of the export to apply styles to cells \(although it can be used for other purposes\). The script block is given three paramaters; an object containing the current worksheet, the Total number of Rows and the number of the last column.
```yaml
Type: ScriptBlock
@@ -1292,6 +1373,7 @@ Accept wildcard characters: False
```
### -Activate
If there is already content in the workbook, a new sheet will not be active UNLESS Activate is specified; when a PivotTable is created its sheet will be activated by this switch.
```yaml
@@ -1307,6 +1389,7 @@ Accept wildcard characters: False
```
### -Now
The -Now switch is a shortcut that automatically creates a temporary file, enables "AutoSize", "TableName" and "Show", and opens the file immediately.
```yaml
@@ -1322,6 +1405,7 @@ Accept wildcard characters: False
```
### -ReturnRange
If specified, Export-Excel returns the range of added cells in the format "A1:Z100".
```yaml
@@ -1337,7 +1421,8 @@ Accept wildcard characters: False
```
### -PivotTotals
By default, PivotTables have totals for each row (on the right) and for each column at the bottom. This allows just one or neither to be selected.
By default, PivotTables have totals for each row \(on the right\) and for each column at the bottom. This allows just one or neither to be selected.
```yaml
Type: String
@@ -1352,6 +1437,7 @@ Accept wildcard characters: False
```
### -NoTotalsInPivot
In a PivotTable created from command line parameters, prevents the addition of totals to rows and columns.
```yaml
@@ -1367,7 +1453,8 @@ Accept wildcard characters: False
```
### -ReZip
If specified, Export-Excel will expand the contents of the .XLSX file (which is multiple files in a zip archive) and rebuild it.
If specified, Export-Excel will expand the contents of the .XLSX file \(which is multiple files in a zip archive\) and rebuild it.
```yaml
Type: SwitchParameter
@@ -1382,13 +1469,15 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.ExcelPackage
## NOTES
## RELATED LINKS

View File

@@ -1,35 +1,39 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Get-ExcelSheetInfo
## SYNOPSIS
Get worksheet names and their indices of an Excel workbook.
## SYNTAX
```
```text
Get-ExcelSheetInfo [-Path] <Object> [<CommonParameters>]
```
## DESCRIPTION
The Get-ExcelSheetInfo cmdlet gets worksheet names and their indices of an Excel workbook.
## EXAMPLES
### EXAMPLE 1
```
```text
Get-ExcelSheetInfo .\Test.xlsx
```
## PARAMETERS
### -Path
Specifies the path to the Excel file. (This parameter is required.)
Specifies the path to the Excel file. \(This parameter is required.\)
```yaml
Type: Object
@@ -44,15 +48,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
CHANGELOG
2016/01/07 Added Created by Johan Akerstrom (https://github.com/CosmosKey)
CHANGELOG 2016/01/07 Added Created by Johan Akerstrom \([https://github.com/CosmosKey](https://github.com/CosmosKey)\)
## RELATED LINKS

View File

@@ -0,0 +1,67 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Get-ExcelWorkbookInfo
## SYNOPSIS
Retrieve information of an Excel workbook.
## SYNTAX
```text
Get-ExcelWorkbookInfo [-Path] <String> [<CommonParameters>]
```
## DESCRIPTION
The Get-ExcelWorkbookInfo cmdlet retrieves information \(LastModifiedBy, LastPrinted, Created, Modified, ...\) fron an Excel workbook. These are the same details that are visible in Windows Explorer when right clicking the Excel file, selecting Properties and check the Details tabpage.
## EXAMPLES
### EXAMPLE 1
```text
Get-ExcelWorkbookInfo .\Test.xlsx
```
CorePropertiesXml : \#document Title : Subject : Author : Konica Minolta User Comments : Keywords : LastModifiedBy : Bond, James \(London\) GBR LastPrinted : 2017-01-21T12:36:11Z Created : 17/01/2017 13:51:32 Category : Status : ExtendedPropertiesXml : \#document Application : Microsoft Excel HyperlinkBase : AppVersion : 14.0300 Company : Secret Service Manager : Modified : 10/02/2017 12:45:37 CustomPropertiesXml : \#document
## PARAMETERS
### -Path
Specifies the path to the Excel file. This parameter is required.
```yaml
Type: String
Parameter Sets: (All)
Aliases: FullName
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
## NOTES
CHANGELOG 2016/01/07 Added Created by Johan Akerstrom \([https://github.com/CosmosKey](https://github.com/CosmosKey)\)
## RELATED LINKS
[https://github.com/dfinke/ImportExcel](https://github.com/dfinke/ImportExcel)

View File

@@ -1,62 +1,69 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Import-Excel
## SYNOPSIS
Create custom objects from the rows in an Excel worksheet.
## SYNTAX
### PathC
```
```text
Import-Excel [-Path] <String> [[-WorksheetName] <String>] [-NoHeader] [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-DataOnly] [-AsText <String[]>] [-Password <String>] [<CommonParameters>]
```
### PathB
```
```text
Import-Excel [-Path] <String> [[-WorksheetName] <String>] -HeaderName <String[]> [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-DataOnly] [-AsText <String[]>] [-Password <String>] [<CommonParameters>]
```
### PathA
```
```text
Import-Excel [-Path] <String> [[-WorksheetName] <String>] [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-DataOnly] [-AsText <String[]>] [-Password <String>] [<CommonParameters>]
```
### PackageC
```
```text
Import-Excel -ExcelPackage <ExcelPackage> [[-WorksheetName] <String>] [-NoHeader] [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-DataOnly] [-AsText <String[]>] [-Password <String>] [<CommonParameters>]
```
### PackageB
```
```text
Import-Excel -ExcelPackage <ExcelPackage> [[-WorksheetName] <String>] -HeaderName <String[]> [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-DataOnly] [-AsText <String[]>] [-Password <String>] [<CommonParameters>]
```
### PackageA
```
```text
Import-Excel -ExcelPackage <ExcelPackage> [[-WorksheetName] <String>] [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-DataOnly] [-AsText <String[]>] [-Password <String>] [<CommonParameters>]
```
## DESCRIPTION
The Import-Excel cmdlet creates custom objects from the rows in an Excel worksheet. Each row is represented as one object.
This is possible without installing Microsoft Excel by using the .NET library 'EPPLus.dll'.
By default, the property names of the objects are retrieved from the column headers. Because an object cannot have a blank property name, only columns with column headers will be imported.
If the default behavior is not desired and you want to import the complete worksheet 'as is', the parameter '-NoHeader' can be used.
In case you want to provide your own property names, you can use the parameter '-HeaderName'.
If the default behavior is not desired and you want to import the complete worksheet 'as is', the parameter '-NoHeader' can be used. In case you want to provide your own property names, you can use the parameter '-HeaderName'.
## EXAMPLES
### EXAMPLE 1
```
```text
----------------------------------------------
| File: Movies.xlsx - Sheet: Actors |
----------------------------------------------
@@ -74,13 +81,14 @@ Address : California
First Name: Jean-Claude
Address : Brussels
```
Import data from an Excel worksheet. One object is created for each row. The property names of the objects consist of the column names defined in the first row. In case a column doesn't have a column header (usually in row 1 when '-StartRow' is not used), then the unnamed columns will be skipped and the data in those columns will not be imported.
Import data from an Excel worksheet. One object is created for each row. The property names of the objects consist of the column names defined in the first row. In case a column doesn't have a column header \(usually in row 1 when '-StartRow' is not used\), then the unnamed columns will be skipped and the data in those columns will not be imported.
Notice that column 'B' is not imported because there's no value in cell 'B1' that can be used as property name for the objects.
### EXAMPLE 2
```
```text
----------------------------------------------
| File: Movies.xlsx - Sheet: Actors |
----------------------------------------------
@@ -105,13 +113,13 @@ P2: Vandamme
P3: Brussels
```
Imports the complete Excel worksheet 'as is' by using the '-NoHeader' switch. One object is created for each row. The property names of the objects will be automatically generated (P1, P2, P3, ..).
Imports the complete Excel worksheet 'as is' by using the '-NoHeader' switch. One object is created for each row. The property names of the objects will be automatically generated \(P1, P2, P3, ..\).
Notice that the column header (row 1) is imported as an object too.
Notice that the column header \(row 1\) is imported as an object too.
### EXAMPLE 3
```
```text
----------------------------------------------------------
| File: Movies.xlsx - Sheet: Movies |
----------------------------------------------------------
@@ -144,13 +152,14 @@ Year : 2012
Rating : 9
Genre :
```
This imports data from an Excel worksheet, and as before one object is created for each row. The property names for the objects are defined in the parameter '-HeaderName'. The properties are named starting from the most left column (A) to the right. In case no value is present in one of the columns, that property will have an empty value.
This imports data from an Excel worksheet, and as before one object is created for each row. The property names for the objects are defined in the parameter '-HeaderName'. The properties are named starting from the most left column \(A\) to the right. In case no value is present in one of the columns, that property will have an empty value.
Notice that empty rows are imported and that data for the property 'Genre' is not present in the worksheet. As such, the 'Genre' property will be blank for all objects.
### EXAMPLE 4
```
```text
----------------------------------------------------------
| File: Movies.xlsx - Sheet: Movies |
----------------------------------------------------------
@@ -176,13 +185,13 @@ P2: 2012
P3: 9
```
Import data from an Excel worksheet, and one object is created for each non-blank row. The property names of the objects (P1, P2, P3, ..) are automatically generated by using the switch '-NoHeader' . The switch '-DataOnly' will speed up the import because empty rows and empty columns are not imported.
Import data from an Excel worksheet, and one object is created for each non-blank row. The property names of the objects \(P1, P2, P3, ..\) are automatically generated by using the switch '-NoHeader' . The switch '-DataOnly' will speed up the import because empty rows and empty columns are not imported.
Notice that empty rows and empty columns are not imported.
### EXAMPLE 5
```
```text
----------------------------------------------------------
| File: Movies.xlsx - Sheet: Actors |
----------------------------------------------------------
@@ -204,23 +213,24 @@ Import data from an Excel worksheet. One object is created for each row. The pro
Notice that only 1 object is imported with only 3 properties. Column B and row 2 are empty and have been disregarded by using the switch '-DataOnly'. The property names have been named with the values provided with the parameter '-HeaderName'. Row number 1 with 'Chuck Norris' has not been imported, because we started the import from row 2 with the parameter '-StartRow 2'.
### EXAMPLE 6
```
```text
PS\> ,(Import-Excel -Path .\SysTables_AdventureWorks2014.xlsx) |
Write-SqlTableData -ServerInstance localhost\DEFAULT -Database BlankDB -SchemaName dbo -TableName MyNewTable_fromExcel -Force
```
Imports data from an Excel file and pipes the result to the Write-SqlTableData command to be INSERTed into a table in a SQL Server database.
The ",( ... )" around the Import-Excel command allows all rows to be imported from the Excel file, prior to pipelining to the Write-SqlTableData cmdlet. This helps prevent a RBAR scenario and is important when trying to import thousands of rows.
The ",\( ... \)" around the Import-Excel command allows all rows to be imported from the Excel file, prior to pipelining to the Write-SqlTableData cmdlet. This helps prevent a RBAR scenario and is important when trying to import thousands of rows.
The -Force parameter will be ignored if the table already exists. However, if a table is not found that matches the values provided by -SchemaName and -TableName parameters, it will create a new table in SQL Server database.
The Write-SqlTableData cmdlet will inherit the column names & datatypes for the new table from the object being piped in.
NOTE: You need to install the SqlServer module from the PowerShell Gallery in oder to get the Write-SqlTableData cmdlet.
The Write-SqlTableData cmdlet will inherit the column names & datatypes for the new table from the object being piped in. NOTE: You need to install the SqlServer module from the PowerShell Gallery in oder to get the Write-SqlTableData cmdlet.
## PARAMETERS
### -Path
Specifies the path to the Excel file.
```yaml
@@ -236,7 +246,8 @@ Accept wildcard characters: False
```
### -ExcelPackage
Instead of specifying a path, provides an Excel Package object (from Open-ExcelPackage). Using this avoids re-reading the whole file when importing multiple parts of it.
Instead of specifying a path, provides an Excel Package object \(from Open-ExcelPackage\). Using this avoids re-reading the whole file when importing multiple parts of it.
To allow multiple read operations Import-Excel does NOT close the package, and you should use Close-ExcelPackage -noSave to close it.
@@ -253,6 +264,7 @@ Accept wildcard characters: False
```
### -WorksheetName
Specifies the name of the worksheet in the Excel workbook to import. By default, if no name is provided, the first worksheet will be imported.
```yaml
@@ -268,6 +280,7 @@ Accept wildcard characters: False
```
### -HeaderName
Specifies custom property names to use, instead of the values defined in the column headers of the TopRow.
If you provide fewer header names than there are columns of data in the worksheet, then data will only be imported from that number of columns - the others will be ignored.
@@ -287,7 +300,8 @@ Accept wildcard characters: False
```
### -NoHeader
Automatically generate property names (P1, P2, P3, ..) instead of the ones defined in the column headers of the TopRow.
Automatically generate property names \(P1, P2, P3, ..\) instead of the ones defined in the column headers of the TopRow.
This switch is best used when you want to import the complete worksheet 'as is' and are not concerned with the property names.
@@ -304,6 +318,7 @@ Accept wildcard characters: False
```
### -StartRow
The row from where we start to import data, all rows above the StartRow are disregarded. By default this is the first row.
When the parameters '-NoHeader' and '-HeaderName' are not provided, this row will contain the column headers that will be used as property names. If either is provided, the property names are automatically created and this row will be treated as a regular row containing data.
@@ -321,6 +336,7 @@ Accept wildcard characters: False
```
### -EndRow
By default all rows up to the last cell in the sheet will be imported. If specified, import stops at this row.
```yaml
@@ -336,7 +352,8 @@ Accept wildcard characters: False
```
### -StartColumn
The number of the first column to read data from (1 by default).
The number of the first column to read data from \(1 by default\).
```yaml
Type: Int32
@@ -351,6 +368,7 @@ Accept wildcard characters: False
```
### -EndColumn
By default the import reads up to the last populated column, -EndColumn tells the import to stop at an earlier number.
```yaml
@@ -366,6 +384,7 @@ Accept wildcard characters: False
```
### -DataOnly
Import only rows and columns that contain data, empty rows and empty columns are not imported.
```yaml
@@ -381,7 +400,8 @@ Accept wildcard characters: False
```
### -AsText
Normally Import-Excel returns the Cell values. AsText allows selected columns to be returned as the text displayed in their cells. (* is supported as a wildcard.)
Normally Import-Excel returns the Cell values. AsText allows selected columns to be returned as the text displayed in their cells. \(\* is supported as a wildcard.\)
```yaml
Type: String[]
@@ -396,7 +416,8 @@ Accept wildcard characters: False
```
### -AsDate
Not all date formats are recognized as indicating the number in the cell represents a date AsDate forces the number which would be returned to be converted to a date. (* is supported as a wildcard.)
Not all date formats are recognized as indicating the number in the cell represents a date AsDate forces the number which would be returned to be converted to a date. \(\* is supported as a wildcard.\)
```yaml
Type: String[]
@@ -411,6 +432,7 @@ Accept wildcard characters: False
```
### -Password
Accepts a string that will be used to open a password protected Excel file.
```yaml
@@ -426,7 +448,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS

View File

@@ -1,50 +1,55 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Join-Worksheet
## SYNOPSIS
Combines data on all the sheets in an Excel worksheet onto a single sheet.
## SYNTAX
### Default (Default)
```
### Default \(Default\)
```text
Join-Worksheet [[-Path] <String>] [-WorkSheetName <Object>] [-Clearsheet] [-NoHeader] [-FromLabel <String>] [-LabelBlocks] [-AutoSize] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-HideSource] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBackgroundColor <Object>] [-TitleBold] [-TitleSize <Int32>] [-PivotTableDefinition <Hashtable>] [-ExcelChartDefinition <Object[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-AutoNameRange] [-RangeName <String>] [-ReturnRange] [-Show] [-PassThru][<CommonParameters>]
```
### Table
```
```text
Join-Worksheet [[-Path] <String>] [-WorkSheetName <Object>] [-Clearsheet] [-NoHeader] [-FromLabel <String>] [-LabelBlocks] [-AutoSize] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-BoldTopRow] [-HideSource] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBackgroundColor <Object>] [-TitleBold] [-TitleSize <Int32>] [-PivotTableDefinition <Hashtable>] [-ExcelChartDefinition <Object[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-AutoNameRange] [-RangeName <String>] -TableName <String> [-TableStyle <TableStyles>] [-ReturnRange] [-Show] [-PassThru] [<CommonParameters>]
```
### PackageTable
```
```text
Join-Worksheet -ExcelPackage <ExcelPackage> [-WorkSheetName <Object>] [-Clearsheet] [-NoHeader] [-FromLabel <String>] [-LabelBlocks] [-AutoSize] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-BoldTopRow] [-HideSource] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBackgroundColor <Object>] [-TitleBold] [-TitleSize <Int32>] [-PivotTableDefinition <Hashtable>] [-ExcelChartDefinition <Object[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-AutoNameRange] [-RangeName <String>] -TableName <String> [-TableStyle <TableStyles>] [-ReturnRange] [-Show] [-PassThru] [<CommonParameters>]
```
### PackageDefault
```
```text
Join-Worksheet -ExcelPackage <ExcelPackage> [-WorkSheetName <Object>] [-Clearsheet] [-NoHeader] [-FromLabel <String>] [-LabelBlocks] [-AutoSize] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-HideSource] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBackgroundColor <Object>] [-TitleBold] [-TitleSize <Int32>] [-PivotTableDefinition <Hashtable>] [-ExcelChartDefinition <Object[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-AutoNameRange] [-RangeName <String>] [-ReturnRange] [-Show] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
Join-Worksheet can work in two main ways, either
*Combining data which has the same layout from many pages into one, or
*Combining pages which have nothing in common.
In the former case the header row is copied from the first sheet and, by default, each row of data is labelled with the name of the sheet it came from.
_Combining data which has the same layout from many pages into one, or_ Combining pages which have nothing in common. In the former case the header row is copied from the first sheet and, by default, each row of data is labelled with the name of the sheet it came from.
In the latter case -NoHeader is specified, and each copied block can have the sheet it came from placed above it as a title.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> foreach ($computerName in @('Server1', 'Server2', 'Server3', 'Server4')) {
Get-Service -ComputerName $computerName |
Select-Object -Property Status, Name, DisplayName, StartType |
@@ -59,7 +64,8 @@ The foreach command gets a list of services running on four servers and exports
The Join-Worksheet command uses the same file and merges the results into a sheet named "Combined". It sets a column header of "Machinename", this column will contain the name of the sheet the data was copied from; after copying the data to the sheet "Combined", the other sheets will be hidden. Join-Worksheet finishes by calling Export-Excel to AutoSize cells, freeze the top row and make it bold and add thePivotTable.
### EXAMPLE 2
```
```text
PS\> Get-CimInstance -ClassName win32_logicaldisk |
Select-Object -Property DeviceId,VolumeName, Size,Freespace |
Export-Excel -Path "$env:computerName.xlsx" -WorkSheetname Volumes -NumberFormat "0,000"
@@ -75,6 +81,7 @@ The Join-Worksheet command copies both onto a page named "Summary".Because the d
## PARAMETERS
### -Path
Path to a new or existing .XLSX file.
```yaml
@@ -90,6 +97,7 @@ Accept wildcard characters: False
```
### -ExcelPackage
An object representing an Excel Package - either from Open-ExcelPackage or specifying -PassThru to Export-Excel.
```yaml
@@ -105,6 +113,7 @@ Accept wildcard characters: False
```
### -WorkSheetName
The name of a sheet within the workbook where the other sheets will be joined together - "Combined" by default.
```yaml
@@ -120,6 +129,7 @@ Accept wildcard characters: False
```
### -Clearsheet
If specified ,any pre-existing target for the joined data will be deleted and re-created; otherwise data will be appended on this sheet.
```yaml
@@ -135,6 +145,7 @@ Accept wildcard characters: False
```
### -NoHeader
Join-Worksheet assumes each sheet has identical headers and the headers should be copied to the target sheet, unless -NoHeader is specified.
```yaml
@@ -150,6 +161,7 @@ Accept wildcard characters: False
```
### -FromLabel
If -NoHeader is NOT specified, then rows of data will be labeled with the name of the sheet they came from. FromLabel is the header for this column. If it is null or empty, the labels will be omitted.
```yaml
@@ -165,6 +177,7 @@ Accept wildcard characters: False
```
### -LabelBlocks
If specified, the copied blocks of data will have the name of the sheet they were copied from inserted above them as a title.
```yaml
@@ -180,6 +193,7 @@ Accept wildcard characters: False
```
### -AutoSize
Sets the width of the Excel columns to display all the data in their cells.
```yaml
@@ -195,6 +209,7 @@ Accept wildcard characters: False
```
### -FreezeTopRow
Freezes headers etc. in the top row.
```yaml
@@ -210,6 +225,7 @@ Accept wildcard characters: False
```
### -FreezeFirstColumn
Freezes titles etc. in the left column.
```yaml
@@ -225,7 +241,8 @@ Accept wildcard characters: False
```
### -FreezeTopRowFirstColumn
Freezes top row and left column (equivalent to Freeze pane 2,2 ).
Freezes top row and left column \(equivalent to Freeze pane 2,2 \).
```yaml
Type: SwitchParameter
@@ -240,7 +257,8 @@ Accept wildcard characters: False
```
### -FreezePane
Freezes panes at specified coordinates (in the formRowNumber , ColumnNumber).
Freezes panes at specified coordinates \(in the formRowNumber , ColumnNumber\).
```yaml
Type: Int32[]
@@ -255,6 +273,7 @@ Accept wildcard characters: False
```
### -AutoFilter
Enables the Excel filter on the headers of the combined sheet.
```yaml
@@ -270,6 +289,7 @@ Accept wildcard characters: False
```
### -BoldTopRow
Makes the top row boldface.
```yaml
@@ -285,6 +305,7 @@ Accept wildcard characters: False
```
### -HideSource
If specified, hides the sheets that the data is copied from.
```yaml
@@ -300,6 +321,7 @@ Accept wildcard characters: False
```
### -Title
Text of a title to be placed in Cell A1.
```yaml
@@ -315,6 +337,7 @@ Accept wildcard characters: False
```
### -TitleFillPattern
Sets the fill pattern for the title cell.
```yaml
@@ -331,6 +354,7 @@ Accept wildcard characters: False
```
### -TitleBackgroundColor
Sets the cell background color for the title cell.
```yaml
@@ -346,6 +370,7 @@ Accept wildcard characters: False
```
### -TitleBold
Sets the title in boldface type.
```yaml
@@ -361,6 +386,7 @@ Accept wildcard characters: False
```
### -TitleSize
Sets the point size for the title.
```yaml
@@ -376,7 +402,8 @@ Accept wildcard characters: False
```
### -PivotTableDefinition
Hashtable(s) with Sheet PivotRows, PivotColumns, PivotData, IncludePivotChart and ChartType values to specify a definition for one or morePivotTable(s).
Hashtable\(s\) with Sheet PivotRows, PivotColumns, PivotData, IncludePivotChart and ChartType values to specify a definition for one or morePivotTable\(s\).
```yaml
Type: Hashtable
@@ -391,6 +418,7 @@ Accept wildcard characters: False
```
### -ExcelChartDefinition
A hashtable containing ChartType, Title, NoLegend, ShowCategory, ShowPercent, Yrange, Xrange and SeriesHeader for one or more \[non-pivot\] charts.
```yaml
@@ -406,6 +434,7 @@ Accept wildcard characters: False
```
### -ConditionalFormat
One or more conditional formatting rules defined with New-ConditionalFormattingIconSet.
```yaml
@@ -421,6 +450,7 @@ Accept wildcard characters: False
```
### -ConditionalText
Applies a Conditional formatting rule defined with New-ConditionalText.
```yaml
@@ -436,6 +466,7 @@ Accept wildcard characters: False
```
### -AutoNameRange
Makes each column a named range.
```yaml
@@ -451,6 +482,7 @@ Accept wildcard characters: False
```
### -RangeName
Makes the data in the worksheet a named range.
```yaml
@@ -466,6 +498,7 @@ Accept wildcard characters: False
```
### -TableName
Makes the data in the worksheet a table with a name and applies a style to it. Name must not contain spaces.
```yaml
@@ -481,6 +514,7 @@ Accept wildcard characters: False
```
### -TableStyle
Selects the style for the named table - defaults to "Medium6".
```yaml
@@ -497,6 +531,7 @@ Accept wildcard characters: False
```
### -ReturnRange
If specified, returns the range of cells in the combined sheet, in the format "A1:Z100".
```yaml
@@ -512,6 +547,7 @@ Accept wildcard characters: False
```
### -Show
Opens the Excel file immediately after creation. Convenient for viewing the results instantly without having to search for the file first.
```yaml
@@ -527,6 +563,7 @@ Accept wildcard characters: False
```
### -PassThru
If specified, an object representing the unsaved Excel package will be returned, it then needs to be saved.
```yaml
@@ -542,7 +579,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -551,3 +589,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,34 +1,36 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Merge-MultipleSheets
## SYNOPSIS
Merges Worksheets into a single Worksheet with differences marked up.
## SYNTAX
```
```text
Merge-MultipleSheets [-Path] <Object> [[-Startrow] <Int32>] [[-Headername] <String[]>] [-NoHeader] [[-WorksheetName] <Object>] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [[-Property] <Object>] [[-ExcludeProperty] <Object>] [[-Key] <Object>] [[-KeyFontColor] <Object>] [[-ChangeBackgroundColor] <Object>] [[-DeleteBackgroundColor] <Object>] [[-AddBackgroundColor] <Object>] [-HideRowNumbers] [-Passthru] [-Show] [<CommonParameters>]
```
## DESCRIPTION
The Merge Worksheet command combines two sheets. Merge-MultipleSheets is designed to merge more than two.
If asked to merge sheets A,B,C which contain Services, with a Name, Displayname and Start mode, where "Name" is treated as the key, Merge-MultipleSheets:
* Calls Merge-Worksheet to merge "Name", "Displayname" and "Startmode" from sheets A and C; the result has column headings "_Row", "Name", "DisplayName", "Startmode", "C-DisplayName", "C-StartMode", "C-Is" and "C-Row".
* Calls Merge-Worksheet again passing it the intermediate result and sheet B, comparing "Name", "Displayname" and "Start mode" columns on each side, and gets a result with columns "_Row", "Name", "DisplayName", "Startmode", "B-DisplayName", "B-StartMode", "B-Is", "B-Row", "C-DisplayName", "C-StartMode", "C-Is" and "C-Row".
Any columns on the "reference" side which are not used in the comparison are added on the right, which is why we compare the sheets in reverse order.
* Calls Merge-Worksheet to merge "Name", "Displayname" and "Startmode" from sheets A and C; the result has column headings "\_Row", "Name", "DisplayName", "Startmode", "C-DisplayName", "C-StartMode", "C-Is" and "C-Row".
* Calls Merge-Worksheet again passing it the intermediate result and sheet B, comparing "Name", "Displayname" and "Start mode" columns on each side, and gets a result with columns "\_Row", "Name", "DisplayName", "Startmode", "B-DisplayName", "B-StartMode", "B-Is", "B-Row", "C-DisplayName", "C-StartMode", "C-Is" and "C-Row".
The "Is" columns hold "Same", "Added", "Removed" or "Changed" and is used for conditional formatting in the output sheet (these columns are hidden by default), and when the data is written to Excel the "reference" columns, in this case "DisplayName" and "Start" are renamed to reflect their source, so they become "A-DisplayName" and "A-Start".
Any columns on the "reference" side which are not used in the comparison are added on the right, which is why we compare the sheets in reverse order.
Conditional formatting is also applied to the Key column ("Name" in this case) so the view can be filtered to rows with changes by filtering this
column on color.
The "Is" columns hold "Same", "Added", "Removed" or "Changed" and is used for conditional formatting in the output sheet \(these columns are hidden by default\), and when the data is written to Excel the "reference" columns, in this case "DisplayName" and "Start" are renamed to reflect their source, so they become "A-DisplayName" and "A-Start".
Conditional formatting is also applied to the Key column \("Name" in this case\) so the view can be filtered to rows with changes by filtering this column on color.
Note: the processing order can affect what is seen as a change.For example, if there is an extra item in sheet B in the example above, Sheet C will be processed first and that row and will not be seen to be missing. When sheet B is processed it is marked as an addition, and the conditional formatting marks the entries from sheet A to show that a values were added in at least one sheet.
@@ -37,34 +39,34 @@ However if Sheet B is the reference sheet, A and C will be seen to have an item
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> dir Server*.xlsx | Merge-MulipleSheets -WorksheetName Services -OutputFile Test2.xlsx -OutputSheetName Services -Show
```
Here we are auditing servers and each one has a workbook in the current directory which contains a "Services" Worksheet (the result of Get-WmiObject -Class win32_service | Select-Object -Property Name, Displayname, Startmode). No key is specified so the key is assumed to be the "Name" column. The files are merged and the result is opened on completion.
Here we are auditing servers and each one has a workbook in the current directory which contains a "Services" Worksheet \(the result of Get-WmiObject -Class win32\_service \| Select-Object -Property Name, Displayname, Startmode\). No key is specified so the key is assumed to be the "Name" column. The files are merged and the result is opened on completion.
### EXAMPLE 2
```
```text
PS\> dir Serv*.xlsx | Merge-MulipleSheets -WorksheetName Software -Key "*" -ExcludeProperty Install* -OutputFile Test2.xlsx -OutputSheetName Software -Show
```
The server audit files in the previous example also have "Software" worksheet, but no single field on that sheet works as a key. Specifying "*" for the key
produces a compound key using all non-excluded fields (and the installation date and file location are excluded).
The server audit files in the previous example also have "Software" worksheet, but no single field on that sheet works as a key. Specifying "\*" for the key produces a compound key using all non-excluded fields \(and the installation date and file location are excluded\).
### EXAMPLE 3
```
```text
Merge-MulipleSheets -Path hotfixes.xlsx -WorksheetName Serv* -Key hotfixid -OutputFile test2.xlsx -OutputSheetName hotfixes -HideRowNumbers -Show
```
This time all the servers have written their hotfix information to their own worksheets in a shared Excel workbook named "Hotfixes.xlsx" (the information was
obtained by running Get-Hotfix | Sort-Object -Property description,hotfixid | Select-Object -Property Description,HotfixID)
This ignores any sheets which are not named "Serv*", and uses the HotfixID as the key; in this version the row numbers are hidden.
This time all the servers have written their hotfix information to their own worksheets in a shared Excel workbook named "Hotfixes.xlsx" \(the information was obtained by running Get-Hotfix \| Sort-Object -Property description,hotfixid \| Select-Object -Property Description,HotfixID\) This ignores any sheets which are not named "Serv\*", and uses the HotfixID as the key; in this version the row numbers are hidden.
## PARAMETERS
### -Path
Paths to the files to be merged.
Files are also accepted
Paths to the files to be merged. Files are also accepted
```yaml
Type: Object
@@ -79,6 +81,7 @@ Accept wildcard characters: False
```
### -Startrow
The row from where we start to import data, all rows above the Start row are disregarded. By default this is the first row.
```yaml
@@ -94,6 +97,7 @@ Accept wildcard characters: False
```
### -Headername
Specifies custom property names to use, instead of the values defined in the column headers of the Start row.
```yaml
@@ -109,7 +113,8 @@ Accept wildcard characters: False
```
### -NoHeader
If specified, property names will be automatically generated (P1, P2, P3, ..) instead of using the values from the start row.
If specified, property names will be automatically generated \(P1, P2, P3, ..\) instead of using the values from the start row.
```yaml
Type: SwitchParameter
@@ -124,7 +129,8 @@ Accept wildcard characters: False
```
### -WorksheetName
Name(s) of Worksheets to compare.
Name\(s\) of Worksheets to compare.
```yaml
Type: Object
@@ -139,6 +145,7 @@ Accept wildcard characters: False
```
### -OutputFile
File to write output to.
```yaml
@@ -154,6 +161,7 @@ Accept wildcard characters: False
```
### -OutputSheetName
Name of Worksheet to output - if none specified will use the reference Worksheet name.
```yaml
@@ -169,7 +177,8 @@ Accept wildcard characters: False
```
### -Property
Properties to include in the comparison - supports wildcards, default is "*".
Properties to include in the comparison - supports wildcards, default is "\*".
```yaml
Type: Object
@@ -184,6 +193,7 @@ Accept wildcard characters: False
```
### -ExcludeProperty
Properties to exclude from the the comparison - supports wildcards.
```yaml
@@ -199,6 +209,7 @@ Accept wildcard characters: False
```
### -Key
Name of a column which is unique used to pair up rows from the reference and difference sides, default is "Name".
```yaml
@@ -214,6 +225,7 @@ Accept wildcard characters: False
```
### -KeyFontColor
Sets the font color for the Key field; this means you can filter by color to get only changed rows.
```yaml
@@ -229,6 +241,7 @@ Accept wildcard characters: False
```
### -ChangeBackgroundColor
Sets the background color for changed rows.
```yaml
@@ -244,6 +257,7 @@ Accept wildcard characters: False
```
### -DeleteBackgroundColor
Sets the background color for rows in the reference but deleted from the difference sheet.
```yaml
@@ -259,6 +273,7 @@ Accept wildcard characters: False
```
### -AddBackgroundColor
Sets the background color for rows not in the reference but added to the difference sheet.
```yaml
@@ -274,6 +289,7 @@ Accept wildcard characters: False
```
### -HideRowNumbers
If specified, hides the columns in the spreadsheet that contain the row numbers.
```yaml
@@ -289,7 +305,8 @@ Accept wildcard characters: False
```
### -Passthru
If specified, outputs the data to the pipeline (you can add -whatif so it the command only outputs to the pipeline).
If specified, outputs the data to the pipeline \(you can add -whatif so it the command only outputs to the pipeline\).
```yaml
Type: SwitchParameter
@@ -304,6 +321,7 @@ Accept wildcard characters: False
```
### -Show
If specified, opens the output workbook.
```yaml
@@ -319,7 +337,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -328,3 +347,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,61 +1,71 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Merge-Worksheet
## SYNOPSIS
Merges two Worksheets (or other objects) into a single Worksheet with differences marked up.
Merges two Worksheets \(or other objects\) into a single Worksheet with differences marked up.
## SYNTAX
### C
```
```text
Merge-Worksheet [-Referencefile] <Object> [-Differencefile] <Object> [[-WorksheetName] <Object>] [-Startrow <Int32>] [-NoHeader] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### B
```
```text
Merge-Worksheet [-Referencefile] <Object> [-Differencefile] <Object> [[-WorksheetName] <Object>] [-Startrow <Int32>] -Headername <String[]> [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### A
```
```text
Merge-Worksheet [-Referencefile] <Object> [-Differencefile] <Object> [[-WorksheetName] <Object>] [-Startrow <Int32>] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### G
```
```text
Merge-Worksheet [-Differencefile] <Object> [[-WorksheetName] <Object>] [-Startrow <Int32>] [-NoHeader] -ReferenceObject <Object> [[-DiffPrefix] <Object>] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### F
```
```text
Merge-Worksheet [-Differencefile] <Object> [[-WorksheetName] <Object>] [-Startrow <Int32>] -Headername <String[]> -ReferenceObject <Object> [[-DiffPrefix] <Object>] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### E
```
```text
Merge-Worksheet [-Differencefile] <Object> [[-WorksheetName] <Object>] [-Startrow <Int32>] -ReferenceObject <Object> [[-DiffPrefix] <Object>] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
### D
```
```text
Merge-Worksheet -ReferenceObject <Object> [-DifferenceObject] <Object> [[-DiffPrefix] <Object>] [[-OutputFile] <Object>] [[-OutputSheetName] <Object>] [-Property <Object>] [-ExcludeProperty <Object>] [-Key <Object>] [-KeyFontColor <Object>] [-ChangeBackgroundColor <Object>] [-DeleteBackgroundColor <Object>] [-AddBackgroundColor <Object>] [-HideEqual] [-Passthru] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
## DESCRIPTION
The Compare-Worksheet command takes two Worksheets and marks differences in the source document, and optionally outputs a grid showing the changes.
By contrast the Merge-Worksheet command takes the Worksheets and combines them into a single sheet showing the old and new data side by side. Although it is designed to work with Excel data it can work with arrays of any kind of object; so it can be a merge *of* Worksheets, or a merge *to* a Worksheet.
By contrast the Merge-Worksheet command takes the Worksheets and combines them into a single sheet showing the old and new data side by side. Although it is designed to work with Excel data it can work with arrays of any kind of object; so it can be a merge _of_ Worksheets, or a merge _to_ a Worksheet.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Merge-Worksheet "Server54.xlsx" "Server55.xlsx" -WorksheetName services -OutputFile Services.xlsx -OutputSheetName 54-55 -show
```
@@ -64,32 +74,35 @@ The workbooks contain audit information for two servers, one sheet contains a li
This command creates a worksheet named "54-55" in a workbook named "services.xlsx" which shows all the services and their differences, and opens the new workbook in Excel.
### EXAMPLE 2
```
```text
PS\> Merge-Worksheet "Server54.xlsx" "Server55.xlsx" -WorksheetName services -OutputFile Services.xlsx -OutputSheetName 54-55 -HideEqual -AddBackgroundColor LightBlue -show
```
This modifies the previous command to hide the equal rows in the output sheet and changes the color used to mark rows added to the second file.
### EXAMPLE 3
```
```text
PS\> Merge-Worksheet -OutputFile .\j1.xlsx -OutputSheetName test11 -ReferenceObject (dir .\ImportExcel\4.0.7) -DifferenceObject (dir .\ImportExcel\4.0.8) -Property Length -Show
```
This version compares two directories, and marks what has changed. Because no "Key" property is given, "Name" is assumed to be the key and the only other property examined is length. Files which are added or deleted or have changed size will be highlighed in the output sheet. Changes to dates or other attributes will be ignored.
### EXAMPLE 4
```
```text
PS\> Merge-Worksheet -RefO (dir .\ImportExcel\4.0.7) -DiffO (dir .\ImportExcel\4.0.8) -Pr Length | Out-GridView
```
This time no file is written and the results - which include all properties, not just length, are output and sent to Out-Gridview.
This version uses aliases to shorten the parameters, (OutputFileName can be "outFile" and the Sheet can be"OutSheet"; DifferenceObject & ReferenceObject can be
DiffObject & RefObject respectively).
This version uses aliases to shorten the parameters, \(OutputFileName can be "outFile" and the Sheet can be"OutSheet"; DifferenceObject & ReferenceObject can be DiffObject & RefObject respectively\).
## PARAMETERS
### -Referencefile
First Excel file to compare. You can compare two Excel files or two other objects or a reference obhct against a difference file, but not a reference file against an object. works with the following parameter sets
* A = Compare two files default headers
@@ -109,6 +122,7 @@ Accept wildcard characters: False
```
### -Differencefile
Second Excel file to compare. Works with paramter sets A,B,C as well as the following
* D = Compare two objects;
@@ -129,7 +143,8 @@ Accept wildcard characters: False
```
### -WorksheetName
Name(s) of Worksheets to compare. Applies to all parameter sets EXCEPT D which is two objects (no sheets)
Name\(s\) of Worksheets to compare. Applies to all parameter sets EXCEPT D which is two objects \(no sheets\)
```yaml
Type: Object
@@ -144,7 +159,8 @@ Accept wildcard characters: False
```
### -Startrow
The row from where we start to import data, all rows above the StartRow are disregarded. By default this is the first row. Applies to all sets EXCEPT D which is two objects (no sheets, so no start row )
The row from where we start to import data, all rows above the StartRow are disregarded. By default this is the first row. Applies to all sets EXCEPT D which is two objects \(no sheets, so no start row \)
```yaml
Type: Int32
@@ -159,22 +175,23 @@ Accept wildcard characters: False
```
### -Headername
Specifies custom property names to use, instead of the values defined in the column headers of the Start Row. Works with the following parameter sets:
* B 2 sheets with user supplied headers
* F Compare object + sheet
```yaml
Type: String[]
Parameter Sets: B, F
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
\`\`\`yaml
Type: String\[\]
Parameter Sets: B, F
Aliases:
Required: True Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False
```text
### -NoHeader
Automatically generate property names (P1, P2, P3, ..) instead of using the values the top row of the sheet. Works with parameter sets
@@ -193,8 +210,8 @@ Accept wildcard characters: False
```
### -ReferenceObject
Reference object to compare if a Worksheet is NOT being used.
Reference object can combine with a difference sheet or difference object
Reference object to compare if a Worksheet is NOT being used. Reference object can combine with a difference sheet or difference object
```yaml
Type: Object
@@ -209,8 +226,8 @@ Accept wildcard characters: False
```
### -DifferenceObject
Difference object to compare if a Worksheet is NOT being used for either half.
Can't have a reference sheet and difference object.
Difference object to compare if a Worksheet is NOT being used for either half. Can't have a reference sheet and difference object.
```yaml
Type: Object
@@ -225,7 +242,8 @@ Accept wildcard characters: False
```
### -DiffPrefix
If there isn't a filename to use to label data from the "Difference" side, DiffPrefix is used, it defaults to "=\>"
If there isn't a filename to use to label data from the "Difference" side, DiffPrefix is used, it defaults to "=&gt;"
```yaml
Type: Object
@@ -240,6 +258,7 @@ Accept wildcard characters: False
```
### -OutputFile
File to hold merged data.
```yaml
@@ -255,6 +274,7 @@ Accept wildcard characters: False
```
### -OutputSheetName
Name of Worksheet to output - if none specified will use the reference Worksheet name.
```yaml
@@ -270,7 +290,8 @@ Accept wildcard characters: False
```
### -Property
Properties to include in the DIFF - supports wildcards, default is "*".
Properties to include in the DIFF - supports wildcards, default is "\*".
```yaml
Type: Object
@@ -285,6 +306,7 @@ Accept wildcard characters: False
```
### -ExcludeProperty
Properties to exclude from the the search - supports wildcards.
```yaml
@@ -300,6 +322,7 @@ Accept wildcard characters: False
```
### -Key
Name of a column which is unique used to pair up rows from the refence and difference side, default is "Name".
```yaml
@@ -315,6 +338,7 @@ Accept wildcard characters: False
```
### -KeyFontColor
Sets the font color for the "key" field; this means you can filter by color to get only changed rows.
```yaml
@@ -330,6 +354,7 @@ Accept wildcard characters: False
```
### -ChangeBackgroundColor
Sets the background color for changed rows.
```yaml
@@ -345,6 +370,7 @@ Accept wildcard characters: False
```
### -DeleteBackgroundColor
Sets the background color for rows in the reference but deleted from the difference sheet.
```yaml
@@ -360,6 +386,7 @@ Accept wildcard characters: False
```
### -AddBackgroundColor
Sets the background color for rows not in the reference but added to the difference sheet.
```yaml
@@ -375,6 +402,7 @@ Accept wildcard characters: False
```
### -HideEqual
if specified, hides the rows in the spreadsheet that are equal and only shows changes, added or deleted rows.
```yaml
@@ -390,7 +418,8 @@ Accept wildcard characters: False
```
### -Passthru
If specified, outputs the data to the pipeline (you can add -WhatIf so the command only outputs to the pipeline).
If specified, outputs the data to the pipeline \(you can add -WhatIf so the command only outputs to the pipeline\).
```yaml
Type: SwitchParameter
@@ -405,6 +434,7 @@ Accept wildcard characters: False
```
### -Show
If specified, opens the output workbook.
```yaml
@@ -420,8 +450,8 @@ Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
Type: SwitchParameter
@@ -436,6 +466,7 @@ Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
@@ -451,7 +482,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -460,3 +492,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,42 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-ConditionalFormattingIconSet
## SYNOPSIS
Creates an object which describes a conditional formatting rule a for 3,4 or 5 icon set.
## SYNTAX
```
```text
New-ConditionalFormattingIconSet [-Range] <Object> [[-ConditionalFormat] <Object>] [-Reverse] [<CommonParameters>]
```
## DESCRIPTION
Export-Excel takes a -ConditionalFormat parameter which can hold one or more descriptions for conditional formats; this command builds the defintion of a Conditional formatting rule for an icon set.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $cfRange = [OfficeOpenXml.ExcelAddress]::new($topRow, $column, $lastDataRow, $column)
PS\> $cfdef = New-ConditionalFormattingIconSet -Range $cfrange -ConditionalFormat ThreeIconSet -IconType Arrows
PS\> Export-Excel -ExcelPackage $excel -ConditionalFormat $cfdef -show
```
The first line creates a range - one column wide in the column $column, running from $topRow to $lastDataRow. The second line creates a definition object using this range and the third uses Export-Excel with an open package to apply the format and save and open the file.
## PARAMETERS
### -Range
The range of cells that the conditional format applies to.
```yaml
@@ -47,6 +52,7 @@ Accept wildcard characters: False
```
### -ConditionalFormat
The type of rule: one of "ThreeIconSet","FourIconSet" or "FiveIconSet"
```yaml
@@ -62,6 +68,7 @@ Accept wildcard characters: False
```
### -Reverse
Use the icons in the reverse order.
```yaml
@@ -77,7 +84,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -87,6 +95,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## RELATED LINKS
[Add-Add-ConditionalFormatting]()
[New-ConditionalText]()
[Add-Add-ConditionalFormatting](new-conditionalformattingiconset.md) [New-ConditionalText](new-conditionalformattingiconset.md)

View File

@@ -1,53 +1,56 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-ConditionalText
## SYNOPSIS
Creates an object which describes a conditional formatting rule for single valued rules.
## SYNTAX
```
```text
New-ConditionalText [[-Text] <Object>] [[-ConditionalTextColor] <Object>] [[-BackgroundColor] <Object>] [[-Range] <String>] [[-PatternType] <ExcelFillStyle>] [[-ConditionalType] <Object>] [<CommonParameters>]
```
## DESCRIPTION
Some Conditional formatting rules don't apply styles to a cell (IconSets and Databars); some take two parameters (Between); some take none (ThisWeek, ContainsErrors, AboveAverage etc).The others take a single parameter (Top, BottomPercent, GreaterThan, Contains etc).
Some Conditional formatting rules don't apply styles to a cell \(IconSets and Databars\); some take two parameters \(Between\); some take none \(ThisWeek, ContainsErrors, AboveAverage etc\).The others take a single parameter \(Top, BottomPercent, GreaterThan, Contains etc\).
This command creates an object to describe the last two categories, which can then be passed to Export-Excel.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $ct = New-ConditionalText -Text 'Ferrari'
PS\> Export-Excel -ExcelPackage $excel -ConditionalTest $ct -show
```
The first line creates a definition object which will highlight the word "Ferrari" in any cell. and the second uses Export-Excel with an open package to apply the format and save and open the file.
### EXAMPLE 2
```
```text
PS\> $ct = New-ConditionalText -Text "Ferrari"
PS\> $ct2 = New-ConditionalText -Range $worksheet.Names\["FinishPosition"\].Address -ConditionalType LessThanOrEqual -Text 3 -ConditionalTextColor Red -BackgroundColor White
PS\> Export-Excel -ExcelPackage $excel -ConditionalText $ct,$ct2 -show
```
This builds on the previous example, and specifies a condition of \<=3 with a format of red text on a white background; this applies to a named range "Finish Position".
This builds on the previous example, and specifies a condition of \&lt;=3 with a format of red text on a white background; this applies to a named range "Finish Position".
The range could be written -Range "C:C" to specify a named column, or -Range "C2:C102" to specify certain cells in the column.
## PARAMETERS
### -Text
The text (or other value) to use in the rule. Note that Equals, GreaterThan/LessThan rules require text to wrapped in double quotes.
The text \(or other value\) to use in the rule. Note that Equals, GreaterThan/LessThan rules require text to wrapped in double quotes.
```yaml
Type: Object
@@ -62,6 +65,7 @@ Accept wildcard characters: False
```
### -ConditionalTextColor
The font color for the cell - by default: "DarkRed".
```yaml
@@ -77,6 +81,7 @@ Accept wildcard characters: False
```
### -BackgroundColor
The fill color for the cell - by default: "LightPink".
```yaml
@@ -92,6 +97,7 @@ Accept wildcard characters: False
```
### -Range
The range of cells that the conditional format applies to; if none is specified the range will be apply to all the data in the sheet.
```yaml
@@ -107,6 +113,7 @@ Accept wildcard characters: False
```
### -PatternType
The background pattern for the cell - by default: "Solid"
```yaml
@@ -123,6 +130,7 @@ Accept wildcard characters: False
```
### -ConditionalType
One of the supported rules; by default "ContainsText" is selected.
```yaml
@@ -138,7 +146,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -148,6 +157,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## RELATED LINKS
[Add-ConditionalFormatting]()
[New-ConditionalFormattingIconSet]()
[Add-ConditionalFormatting](new-conditionaltext.md) [New-ConditionalFormattingIconSet](new-conditionaltext.md)

View File

@@ -1,29 +1,31 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-ExcelChartDefinition
## SYNOPSIS
Creates a Definition of a chart which can be added using Export-Excel, or Add-PivotTable
## SYNTAX
```
```text
New-ExcelChartDefinition [[-Title] <Object>] [[-Header] <Object>] [[-ChartType] <eChartType>] [[-ChartTrendLine] <eTrendLine[]>] [[-XRange] <Object>] [[-YRange] <Object>] [[-Width] <Object>] [[-Height] <Object>] [[-Row] <Object>] [[-RowOffSetPixels] <Object>] [[-Column] <Object>] [[-ColumnOffSetPixels] <Object>] [[-LegendPosition] <eLegendPosition>] [[-LegendSize] <Object>] [-LegendBold] [-NoLegend] [-ShowCategory] [-ShowPercent] [[-SeriesHeader] <Object>] [-TitleBold] [[-TitleSize] <Int32>] [[-XAxisTitleText] <String>] [-XAxisTitleBold] [[-XAxisTitleSize] <Object>] [[-XAxisNumberformat] <String>] [[-XMajorUnit] <Object>] [[-XMinorUnit] <Object>] [[-XMaxValue] <Object>] [[-XMinValue] <Object>] [[-XAxisPosition] <eAxisPosition>] [[-YAxisTitleText] <String>] [-YAxisTitleBold] [[-YAxisTitleSize] <Object>] [[-YAxisNumberformat] <String>] [[-YMajorUnit] <Object>] [[-YMinorUnit] <Object>] [[-YMaxValue] <Object>] [[-YMinValue] <Object>] [[-YAxisPosition] <eAxisPosition>] [<CommonParameters>]
```
## DESCRIPTION
All the parameters which are passed to Add-ExcelChart can be added to a chart-definition object and passed to Export-Excel with the -ExcelChartDefinition parameter,
or to Add-PivotTable with the -PivotChartDefinition parameter. This command sets up those definition objects.
All the parameters which are passed to Add-ExcelChart can be added to a chart-definition object and passed to Export-Excel with the -ExcelChartDefinition parameter, or to Add-PivotTable with the -PivotChartDefinition parameter. This command sets up those definition objects.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $cDef = New-ExcelChartDefinition -ChartType line -XRange "X" -YRange "Sinx" -Title "Graph of Sine X" -TitleBold -TitleSize 14 -Column 2 -ColumnOffSetPixels 35 -Width 800 -XAxisTitleText "Degrees" -XAxisTitleBold -XAxisTitleSize 12 -XMajorUnit 30 -XMinorUnit 10 -XMinValue 0 -XMaxValue 361 -XAxisNumberformat "000" -YMinValue -1.25 -YMaxValue 1.25 -YMajorUnit 0.25 -YAxisNumberformat "0.00" -YAxisTitleText "Sine" -YAxisTitleBold -YAxisTitleSize 12 -SeriesHeader "Sin(x)" -LegendSize 8 -legendBold -LegendPosition Bottom
PS\> 0..360 | ForEach-Object {[pscustomobject][ordered]@{x = $_; Sinx = "=Sin(Radians(x)) "}} | Export-Excel -AutoNameRange -now -WorkSheetname SinX -ExcelChartDefinition $cDef -Show
```
@@ -33,6 +35,7 @@ This reworks an example from Add-Excel-Chart but here the chart is defined and t
## PARAMETERS
### -Title
The title for the chart.
```yaml
@@ -48,6 +51,7 @@ Accept wildcard characters: False
```
### -Header
No longer used. This may be removed in future versions.
```yaml
@@ -63,6 +67,7 @@ Accept wildcard characters: False
```
### -ChartType
One of the built-in chart types, such as Pie, ClusteredColumn, Line etc. Defaults to "ColumnStacked".
```yaml
@@ -79,6 +84,7 @@ Accept wildcard characters: False
```
### -ChartTrendLine
Superimposes one of Excel's trenline types on the chart.
```yaml
@@ -95,6 +101,7 @@ Accept wildcard characters: False
```
### -XRange
The range of cells containing values for the X-Axis - usually labels.
```yaml
@@ -110,7 +117,8 @@ Accept wildcard characters: False
```
### -YRange
The range(s) of cells holding values for the Y-Axis - usually "data".
The range\(s\) of cells holding values for the Y-Axis - usually "data".
```yaml
Type: Object
@@ -125,6 +133,7 @@ Accept wildcard characters: False
```
### -Width
Width of the chart in pixels. Defaults to 500.
```yaml
@@ -140,6 +149,7 @@ Accept wildcard characters: False
```
### -Height
Height of the chart in pixels. Defaults to 350.
```yaml
@@ -155,6 +165,7 @@ Accept wildcard characters: False
```
### -Row
Row position of the top left corner of the chart. 0 places it at the top of the sheet, 1 below row 1 and so on.
```yaml
@@ -170,6 +181,7 @@ Accept wildcard characters: False
```
### -RowOffSetPixels
Offset to position the chart by a fraction of a row.
```yaml
@@ -185,6 +197,7 @@ Accept wildcard characters: False
```
### -Column
Column position of the top left corner of the chart. 0 places it at the edge of the sheet, 1 to the right of column A and so on.
```yaml
@@ -200,6 +213,7 @@ Accept wildcard characters: False
```
### -ColumnOffSetPixels
Offset to position the chart by a fraction of a column.
```yaml
@@ -215,6 +229,7 @@ Accept wildcard characters: False
```
### -LegendPosition
Location of the key, either "Left", "Right", "Top", "Bottom" or "TopRight".
```yaml
@@ -231,6 +246,7 @@ Accept wildcard characters: False
```
### -LegendSize
Font size for the key.
```yaml
@@ -246,6 +262,7 @@ Accept wildcard characters: False
```
### -LegendBold
Sets the key in bold type.
```yaml
@@ -261,6 +278,7 @@ Accept wildcard characters: False
```
### -NoLegend
If specified, turns off display of the key. If you only have one data series it may be preferable to use the title to say what the chart is.
```yaml
@@ -276,6 +294,7 @@ Accept wildcard characters: False
```
### -ShowCategory
Attaches a category label in charts which support this.
```yaml
@@ -291,6 +310,7 @@ Accept wildcard characters: False
```
### -ShowPercent
Attaches a percentage label in charts which support this.
```yaml
@@ -306,7 +326,8 @@ Accept wildcard characters: False
```
### -SeriesHeader
Specifies explicit name(s) for the data series, which will appear in the legend/key
Specifies explicit name\(s\) for the data series, which will appear in the legend/key
```yaml
Type: Object
@@ -321,6 +342,7 @@ Accept wildcard characters: False
```
### -TitleBold
Sets the title in bold face.
```yaml
@@ -336,6 +358,7 @@ Accept wildcard characters: False
```
### -TitleSize
Sets the point size for the title.
```yaml
@@ -351,6 +374,7 @@ Accept wildcard characters: False
```
### -XAxisTitleText
Specifies a title for the X-axis.
```yaml
@@ -366,6 +390,7 @@ Accept wildcard characters: False
```
### -XAxisTitleBold
Sets the X-axis title in bold face.
```yaml
@@ -381,6 +406,7 @@ Accept wildcard characters: False
```
### -XAxisTitleSize
Sets the font size for the axis title.
```yaml
@@ -396,7 +422,8 @@ Accept wildcard characters: False
```
### -XAxisNumberformat
A number formatting string, like "#,##0.00", for numbers along the X-axis.
A number formatting string, like "\#,\#\#0.00", for numbers along the X-axis.
```yaml
Type: String
@@ -411,6 +438,7 @@ Accept wildcard characters: False
```
### -XMajorUnit
Spacing for the major gridlines / tick marks along the X-axis.
```yaml
@@ -426,6 +454,7 @@ Accept wildcard characters: False
```
### -XMinorUnit
Spacing for the minor gridlines / tick marks along the X-axis.
```yaml
@@ -441,6 +470,7 @@ Accept wildcard characters: False
```
### -XMaxValue
Maximum value for the scale along the X-axis.
```yaml
@@ -456,6 +486,7 @@ Accept wildcard characters: False
```
### -XMinValue
Minimum value for the scale along the X-axis.
```yaml
@@ -471,7 +502,8 @@ Accept wildcard characters: False
```
### -XAxisPosition
Position for the X-axis ("Top" or" Bottom").
Position for the X-axis \("Top" or" Bottom"\).
```yaml
Type: eAxisPosition
@@ -487,6 +519,7 @@ Accept wildcard characters: False
```
### -YAxisTitleText
Specifies a title for the Y-axis.
```yaml
@@ -502,6 +535,7 @@ Accept wildcard characters: False
```
### -YAxisTitleBold
Sets the Y-axis title in bold face.
```yaml
@@ -517,6 +551,7 @@ Accept wildcard characters: False
```
### -YAxisTitleSize
Sets the font size for the Y-axis title.
```yaml
@@ -532,7 +567,8 @@ Accept wildcard characters: False
```
### -YAxisNumberformat
A number formatting string, like "#,##0.00", for numbers on the Y-axis
A number formatting string, like "\#,\#\#0.00", for numbers on the Y-axis
```yaml
Type: String
@@ -547,6 +583,7 @@ Accept wildcard characters: False
```
### -YMajorUnit
Spacing for the major gridlines / tick marks on the Y-axis.
```yaml
@@ -562,6 +599,7 @@ Accept wildcard characters: False
```
### -YMinorUnit
Spacing for the minor gridlines / tick marks on the Y-axis.
```yaml
@@ -577,6 +615,7 @@ Accept wildcard characters: False
```
### -YMaxValue
Maximum value on the Y-axis.
```yaml
@@ -592,6 +631,7 @@ Accept wildcard characters: False
```
### -YMinValue
Minimum value on the Y-axis.
```yaml
@@ -607,7 +647,8 @@ Accept wildcard characters: False
```
### -YAxisPosition
Position for the Y-axis ("Left" or "Right").
Position for the Y-axis \("Left" or "Right"\).
```yaml
Type: eAxisPosition
@@ -623,7 +664,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -632,3 +674,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,28 +1,32 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-PivotTableDefinition
## SYNOPSIS
Creates PivotTable definitons for Export-Excel
## SYNTAX
### ChartbyDef
```
```text
New-PivotTableDefinition -PivotTableName <Object> [-SourceWorkSheet <Object>] [-SourceRange <Object>] [-PivotRows <Object>] [-PivotData <Hashtable>] [-PivotColumns <Object>] [-PivotFilter <Object>] [-PivotDataToColumn] [-PivotTotals <String>] [-NoTotalsInPivot] [-GroupDateRow <String>] [-GroupDatePart <eDateGroupBy[]>] [-GroupNumericRow <String>] [-GroupNumericMin <Double>] [-GroupNumericMax <Double>] [-GroupNumericInterval <Double>] [-PivotNumberFormat <String>] [-PivotTableStyle <TableStyles>] -PivotChartDefinition <Object> [-Activate] [<CommonParameters>]
```
### ChartbyParams
```
```text
New-PivotTableDefinition -PivotTableName <Object> [-SourceWorkSheet <Object>] [-SourceRange <Object>] [-PivotRows <Object>] [-PivotData <Hashtable>] [-PivotColumns <Object>] [-PivotFilter <Object>] [-PivotDataToColumn] [-PivotTotals <String>] [-NoTotalsInPivot] [-GroupDateRow <String>] [-GroupDatePart <eDateGroupBy[]>] [-GroupNumericRow <String>] [-GroupNumericMin <Double>] [-GroupNumericMax <Double>] [-GroupNumericInterval <Double>] [-PivotNumberFormat <String>] [-PivotTableStyle <TableStyles>] [-IncludePivotChart] [-ChartTitle <String>] [-ChartHeight <Int32>] [-ChartWidth <Int32>] [-ChartRow <Int32>] [-ChartColumn <Int32>] [-ChartRowOffSetPixels <Int32>] [-ChartColumnOffSetPixels <Int32>] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-Activate] [<CommonParameters>]
```
## DESCRIPTION
Export-Excel allows a single PivotTable to be defined using the parameters -IncludePivotTable, -PivotColumns, -PivotRows, -PivotData, -PivotFilter, -PivotTotals, -PivotDataToColumn, -IncludePivotChart and -ChartType.
Its -PivotTableDefintion paramater allows multiple PivotTables to be defined, with additional parameters. New-PivotTableDefinition is a convenient way to build these definitions.
@@ -30,18 +34,21 @@ Its -PivotTableDefintion paramater allows multiple PivotTables to be defined, wi
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $pt = New-PivotTableDefinition -PivotTableName "PT1" -SourceWorkSheet "Sheet1" -PivotRows "Status" -PivotData @{Status='Count'} -PivotFilter 'StartType' -IncludePivotChart -ChartType BarClustered3D
PS\> $Pt += New-PivotTableDefinition -PivotTableName "PT2" -SourceWorkSheet "Sheet2" -PivotRows "Company" -PivotData @{Company='Count'} -IncludePivotChart -ChartType PieExploded3D -ShowPercent -ChartTitle "Breakdown of processes by company"
PS\> Get-Service | Select-Object -Property Status,Name,DisplayName,StartType | Export-Excel -Path .\test.xlsx -AutoSize
PS\> Get-Process | Select-Object -Property Name,Company,Handles,CPU,VM | Export-Excel -Path .\test.xlsx -AutoSize -WorksheetName 'sheet2'
PS\> $excel = Export-Excel -Path .\test.xlsx -PivotTableDefinition $pt -Show
```
This is a re-work of one of the examples in Export-Excel - instead of writing out the pivot definition hash-table, it is built by calling New-PivotTableDefinition.
## PARAMETERS
### -PivotTableName
Name for the new pivot table
This command previously had a typo - and has an alias to avoid breaking scripts This will be removed in a future release
@@ -59,6 +66,7 @@ Accept wildcard characters: False
```
### -SourceWorkSheet
Worksheet where the data is found
```yaml
@@ -74,6 +82,7 @@ Accept wildcard characters: False
```
### -SourceRange
Address range in the worksheet e.g "A10:F20" - the first row must contain the column names to pivot by: if the range is not specified the whole source sheet will be used.
```yaml
@@ -89,6 +98,7 @@ Accept wildcard characters: False
```
### -PivotRows
Fields to set as rows in the PivotTable
```yaml
@@ -104,6 +114,7 @@ Accept wildcard characters: False
```
### -PivotData
A hash-table in form "FieldName"="Function", where function is one of Average, Count, CountNums, Max, Min, Product, None, StdDev, StdDevP, Sum, Var, VarP
```yaml
@@ -119,6 +130,7 @@ Accept wildcard characters: False
```
### -PivotColumns
Fields to set as columns in the PivotTable
```yaml
@@ -134,6 +146,7 @@ Accept wildcard characters: False
```
### -PivotFilter
Fields to use to filter in the PivotTable
```yaml
@@ -149,6 +162,7 @@ Accept wildcard characters: False
```
### -PivotDataToColumn
If there are multiple datasets in a PivotTable, by default they are shown seperatate rows under the given row heading; this switch makes them seperate columns.
```yaml
@@ -164,7 +178,8 @@ Accept wildcard characters: False
```
### -PivotTotals
By default PivotTables have Totals for each Row (on the right) and for each column at the bottom. This allows just one or neither to be selected.
By default PivotTables have Totals for each Row \(on the right\) and for each column at the bottom. This allows just one or neither to be selected.
```yaml
Type: String
@@ -179,6 +194,7 @@ Accept wildcard characters: False
```
### -NoTotalsInPivot
Included for compatibility - equivalent to -PivotTotals "None"
```yaml
@@ -194,7 +210,8 @@ Accept wildcard characters: False
```
### -GroupDateRow
The name of a row field which should be grouped by parts of the date/time (ignored if GroupDatePart is not specified)
The name of a row field which should be grouped by parts of the date/time \(ignored if GroupDatePart is not specified\)
```yaml
Type: String
@@ -209,7 +226,8 @@ Accept wildcard characters: False
```
### -GroupDatePart
The Part(s) of the date to use in the grouping (ignored if GroupDateRow is not specified)
The Part\(s\) of the date to use in the grouping \(ignored if GroupDateRow is not specified\)
```yaml
Type: eDateGroupBy[]
@@ -225,7 +243,8 @@ Accept wildcard characters: False
```
### -GroupNumericRow
The name of a row field which should be grouped by Number (e.g 0-99, 100-199, 200-299 )
The name of a row field which should be grouped by Number \(e.g 0-99, 100-199, 200-299 \)
```yaml
Type: String
@@ -240,6 +259,7 @@ Accept wildcard characters: False
```
### -GroupNumericMin
The starting point for grouping
```yaml
@@ -255,6 +275,7 @@ Accept wildcard characters: False
```
### -GroupNumericMax
The endpoint for grouping
```yaml
@@ -270,6 +291,7 @@ Accept wildcard characters: False
```
### -GroupNumericInterval
The interval for grouping
```yaml
@@ -285,6 +307,7 @@ Accept wildcard characters: False
```
### -PivotNumberFormat
Number format to apply to the data cells in the PivotTable
```yaml
@@ -300,6 +323,7 @@ Accept wildcard characters: False
```
### -PivotTableStyle
Apply a table style to the PivotTable
```yaml
@@ -316,6 +340,7 @@ Accept wildcard characters: False
```
### -PivotChartDefinition
Use a chart definition instead of specifying chart settings one by one
```yaml
@@ -331,6 +356,7 @@ Accept wildcard characters: False
```
### -IncludePivotChart
If specified a chart Will be included.
```yaml
@@ -346,6 +372,7 @@ Accept wildcard characters: False
```
### -ChartTitle
Optional title for the pivot chart, by default the title omitted.
```yaml
@@ -361,7 +388,8 @@ Accept wildcard characters: False
```
### -ChartHeight
Height of the chart in Pixels (400 by default)
Height of the chart in Pixels \(400 by default\)
```yaml
Type: Int32
@@ -376,7 +404,8 @@ Accept wildcard characters: False
```
### -ChartWidth
Width of the chart in Pixels (600 by default)
Width of the chart in Pixels \(600 by default\)
```yaml
Type: Int32
@@ -391,7 +420,8 @@ Accept wildcard characters: False
```
### -ChartRow
Cell position of the top left corner of the chart, there will be this number of rows above the top edge of the chart (default is 0, chart starts at top edge of row 1).
Cell position of the top left corner of the chart, there will be this number of rows above the top edge of the chart \(default is 0, chart starts at top edge of row 1\).
```yaml
Type: Int32
@@ -406,7 +436,8 @@ Accept wildcard characters: False
```
### -ChartColumn
Cell position of the top left corner of the chart, there will be this number of cells to the left of the chart (default is 4, chart starts at left edge of column E)
Cell position of the top left corner of the chart, there will be this number of cells to the left of the chart \(default is 4, chart starts at left edge of column E\)
```yaml
Type: Int32
@@ -421,6 +452,7 @@ Accept wildcard characters: False
```
### -ChartRowOffSetPixels
Vertical offset of the chart from the cell corner.
```yaml
@@ -436,6 +468,7 @@ Accept wildcard characters: False
```
### -ChartColumnOffSetPixels
Horizontal offset of the chart from the cell corner.
```yaml
@@ -451,6 +484,7 @@ Accept wildcard characters: False
```
### -ChartType
Type of chart
```yaml
@@ -467,6 +501,7 @@ Accept wildcard characters: False
```
### -NoLegend
If specified hides the chart legend
```yaml
@@ -482,6 +517,7 @@ Accept wildcard characters: False
```
### -ShowCategory
if specified attaches the category to slices in a pie chart : not supported on all chart types, this may give errors if applied to an unsupported type.
```yaml
@@ -497,6 +533,7 @@ Accept wildcard characters: False
```
### -ShowPercent
If specified attaches percentages to slices in a pie chart.
```yaml
@@ -512,6 +549,7 @@ Accept wildcard characters: False
```
### -Activate
If there is already content in the workbook the sheet with the PivotTable will not be active UNLESS Activate is specified
```yaml
@@ -527,7 +565,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -536,3 +575,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,22 +1,24 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Open-ExcelPackage
## SYNOPSIS
Returns an ExcelPackage object for the specified XLSX fil.e
## SYNTAX
```
```text
Open-ExcelPackage [-Path] <Object> [-KillExcel] [[-Password] <String>] [-Create] [<CommonParameters>]
```
## DESCRIPTION
Import-Excel and Export-Excel open an Excel file, carry out their tasks and close it again.
Sometimes it is necessary to open a file and do other work on it. Open-ExcelPackage allows the file to be opened for these tasks.
@@ -26,7 +28,8 @@ It takes a -KillExcel switch to make sure Excel is not holding the file open; a
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $excel = Open-ExcelPackage -Path "$env:TEMP\test99.xlsx" -Create
PS\> $ws = Add-WorkSheet -ExcelPackage $excel
```
@@ -34,20 +37,20 @@ PS\> $ws = Add-WorkSheet -ExcelPackage $excel
This will create a new file in the temp folder if it doesn't already exist. It then adds a worksheet - because no name is specified it will use the default name of "Sheet1"
### EXAMPLE 2
```
```text
PS\> $excela= Open-ExcelPackage -path "$xlPath" -Password $password
PS\> $sheet1 = $excel.Workbook.Worksheetsa"sheet1" ]
PS\> Set-ExcelRange -Range $sheet1.Cells ["E1:S1048576" ], $sheet1.Cells ["V1:V1048576" ] -NFormat ( [cultureinfo ]::CurrentCulture.DateTimeFormat.ShortDatePattern)
PS\> Close-ExcelPackage $excel -Show
```
This will open the password protected file at $xlPath using the password stored in $Password.
Sheet1 is selected and formatting applied to two blocks of the sheet; then the file is and saved and loaded into Excel.
This will open the password protected file at $xlPath using the password stored in $Password. Sheet1 is selected and formatting applied to two blocks of the sheet; then the file is and saved and loaded into Excel.
## PARAMETERS
### -Path
The path to the file to open.
```yaml
@@ -63,6 +66,7 @@ Accept wildcard characters: False
```
### -KillExcel
If specified, any running instances of Excel will be terminated before opening the file. This may result in lost work, so should be used with caution.
```yaml
@@ -78,7 +82,8 @@ Accept wildcard characters: False
```
### -Password
The password for a protected worksheet, as a \[normal\] string (not a secure string).
The password for a protected worksheet, as a \[normal\] string \(not a secure string\).
```yaml
Type: String
@@ -93,6 +98,7 @@ Accept wildcard characters: False
```
### -Create
By default Open-ExcelPackage will only open an existing file; -Create instructs it to create a new file if required.
```yaml
@@ -108,13 +114,16 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.ExcelPackage
## NOTES
## RELATED LINKS

View File

@@ -1,46 +1,51 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Remove-WorkSheet
## SYNOPSIS
Removes one or more worksheets from one or more workbooks
## SYNTAX
```
```text
Remove-WorkSheet [[-FullName] <Object>] [[-WorksheetName] <String[]>] [-Show] [-WhatIf] [-Confirm] [<CommonParameters>]
```
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Remove-WorkSheet -Path Test1.xlsx -WorksheetName Sheet1
```
Removes the worksheet named 'Sheet1' from 'Test1.xlsx'
### EXAMPLE 2
```
```text
PS\> Remove-WorkSheet -Path Test1.xlsx -WorksheetName Sheet1,Target1
```
Removes the worksheet named 'Sheet1' and 'Target1' from 'Test1.xlsx'
### EXAMPLE 3
```
```text
PS\> Remove-WorkSheet -Path Test1.xlsx -WorksheetName Sheet1,Target1 -Show
```
Removes the worksheets and then launches the xlsx in Excel
### EXAMPLE 1
```
```text
PS\> dir c:\reports\*.xlsx | Remove-WorkSheet
```
@@ -49,7 +54,8 @@ Removes 'Sheet1' from all the xlsx files in the c:\reports directory
## PARAMETERS
### -FullName
The fully qualified path to the XLSX file(s)
The fully qualified path to the XLSX file\(s\)
```yaml
Type: Object
@@ -64,7 +70,8 @@ Accept wildcard characters: False
```
### -WorksheetName
The worksheet to be removed (sheet1 by default)
The worksheet to be removed \(sheet1 by default\)
```yaml
Type: String[]
@@ -79,6 +86,7 @@ Accept wildcard characters: False
```
### -Show
If specified the file will be opened in excel after the sheet is removed.
```yaml
@@ -94,6 +102,7 @@ Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
```yaml
@@ -109,6 +118,7 @@ Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
@@ -124,7 +134,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -133,3 +144,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,53 +1,61 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Select-Worksheet
## SYNOPSIS
Sets the selected tab in an Excel workbook to be the chosen sheet and unselects all the others.
## SYNTAX
### Package
```
```text
Select-Worksheet [-ExcelPackage] <ExcelPackage> [-WorksheetName <String>] [<CommonParameters>]
```
### Workbook
```
```text
Select-Worksheet [-WorksheetName <String>] [<CommonParameters>]
```
### Sheet
```
```text
Select-Worksheet -ExcelWorksheet <ExcelWorksheet> [<CommonParameters>]
```
## DESCRIPTION
Sometimes when a sheet is added we want it to be the active sheet, sometimes we want the active sheet to be left as it was. Select-Worksheet exists to change which sheet is the selected tab when Excel opens the file.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Select-Worksheet -ExcelWorkbook $ExcelWorkbook -WorksheetName "NewSheet"
```
$ExcelWorkbook holds a workbook object containing a sheet named "NewSheet"; This sheet will become the \[only\] active sheet in the workbook
### EXAMPLE 2
```
```text
PS\> Select-Worksheet -ExcelPackage $Pkg -WorksheetName "NewSheet2"
```
$pkg holds an Excel Package, whose workbook contains a sheet named "NewSheet2" This sheet will become the \[only\] active sheet in the workbook.
### EXAMPLE 3
```
```text
PS\> Select-Worksheet -ExcelWorksheet $ws
```
@@ -56,6 +64,7 @@ $ws holds an Excel worksheet which will become the \[only\] active sheet in its
## PARAMETERS
### -ExcelPackage
An object representing an ExcelPackage.
```yaml
@@ -71,6 +80,7 @@ Accept wildcard characters: False
```
### -ExcelWorkbook
An Excel workbook to which the Worksheet will be added - a package contains one Workbook so you can use workbook or package as it suits.
```yaml
@@ -86,6 +96,7 @@ Accept wildcard characters: False
```
### -WorksheetName
The name of the worksheet "Sheet1" by default.
```yaml
@@ -101,6 +112,7 @@ Accept wildcard characters: False
```
### -ExcelWorksheet
An object representing an Excel worksheet.
```yaml
@@ -116,7 +128,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -125,3 +138,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,19 +1,21 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Send-SQLDataToExcel
## SYNOPSIS
Inserts a DataTable - returned by a SQL query - into an ExcelSheet
## SYNTAX
### none (Default)
```
### none \(Default\)
```text
Send-SQLDataToExcel [-QueryTimeout <Int32>] [-Force] [-Path <String>] [-ExcelPackage <ExcelPackage>]
[-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>] [-ClearSheet] [-Append] [-Title <String>]
[-TitleFillPattern <ExcelFillStyle>] [-TitleBold] [-TitleSize <Int32>] [-TitleBackgroundColor <Object>]
@@ -32,7 +34,8 @@ Send-SQLDataToExcel [-QueryTimeout <Int32>] [-Force] [-Path <String>] [-ExcelPac
```
### ODBCConnection
```
```text
Send-SQLDataToExcel -Connection <Object> -SQL <String> [-QueryTimeout <Int32>] [-Force] [-Path <String>]
[-ExcelPackage <ExcelPackage>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>]
[-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBold]
@@ -52,40 +55,47 @@ Send-SQLDataToExcel -Connection <Object> -SQL <String> [-QueryTimeout <Int32>] [
```
### SQLConnection
```
```text
Send-SQLDataToExcel -Connection <Object> [-MsSQLserver] [-DataBase <String>] -SQL <String> [-QueryTimeout <Int32>] [-Force] [-Path <String>] [-ExcelPackage <ExcelPackage>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>] [-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBold] [-TitleSize <Int32>] [-TitleBackgroundColor <Object>] [-IncludePivotTable] [-PivotTableName <String>] [-PivotRows <String[]>] [-PivotColumns <String[]>] [-PivotData <Object>] [-PivotFilter <String[]>] [-PivotDataToColumn] [-PivotTableDefinition <Hashtable>] [-IncludePivotChart] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-AutoSize] [-MaxAutoSizeRows <Object>] [-NoClobber] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-NoHeader] [-RangeName <String>] [-TableName <Object>] [-TableStyle <TableStyles>] [-Barchart] [-PieChart] [-LineChart] [-ColumnChart] [-ExcelChartDefinition <Object[]>] [-HideSheet <String[]>] [-UnHideSheet <String[]>] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-KillExcel] [-AutoNameRange] [-StartRow <Int32>] [-StartColumn <Int32>] [-PassThru] [-Numberformat <String>] [-ExcludeProperty <String[]>] [-NoAliasOrScriptPropeties] [-DisplayPropertySet] [-NoNumberConversion <String[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-Style <Object[]>] [-CellStyleSB <ScriptBlock>] [-Activate] [-Now] [-ReturnRange] [-PivotTotals <String>] [-NoTotalsInPivot] [-ReZip] [<CommonParameters>]
```
### ExistingSession
```
```text
Send-SQLDataToExcel -Session <Object> -SQL <String> [-QueryTimeout <Int32>] [-Force] [-Path <String>] [-ExcelPackage <ExcelPackage>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>] [-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBold] [-TitleSize <Int32>] [-TitleBackgroundColor <Object>] [-IncludePivotTable] [-PivotTableName <String>] [-PivotRows <String[]>] [-PivotColumns <String[]>] [-PivotData <Object>] [-PivotFilter <String[]>] [-PivotDataToColumn] [-PivotTableDefinition <Hashtable>] [-IncludePivotChart] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-AutoSize] [-MaxAutoSizeRows <Object>] [-NoClobber] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-NoHeader] [-RangeName <String>] [-TableName <Object>] [-TableStyle <TableStyles>] [-Barchart] [-PieChart] [-LineChart] [-ColumnChart] [-ExcelChartDefinition <Object[]>] [-HideSheet <String[]>] [-UnHideSheet <String[]>] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-KillExcel] [-AutoNameRange] [-StartRow <Int32>] [-StartColumn <Int32>] [-PassThru] [-Numberformat <String>] [-ExcludeProperty <String[]>] [-NoAliasOrScriptPropeties] [-DisplayPropertySet] [-NoNumberConversion <String[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-Style <Object[]>] [-CellStyleSB <ScriptBlock>] [-Activate] [-Now] [-ReturnRange] [-PivotTotals <String>] [-NoTotalsInPivot] [-ReZip] [<CommonParameters>]
```
### Pre-FetchedData
```
```text
Send-SQLDataToExcel [-QueryTimeout <Int32>] -DataTable <DataTable> [-Force] [-Path <String>] [-ExcelPackage <ExcelPackage>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <String>] [-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern <ExcelFillStyle>] [-TitleBold] [-TitleSize <Int32>] [-TitleBackgroundColor <Object>] [-IncludePivotTable] [-PivotTableName <String>] [-PivotRows <String[]>] [-PivotColumns <String[]>] [-PivotData <Object>] [-PivotFilter <String[]>] [-PivotDataToColumn] [-PivotTableDefinition <Hashtable>] [-IncludePivotChart] [-ChartType <eChartType>] [-NoLegend] [-ShowCategory] [-ShowPercent] [-AutoSize] [-MaxAutoSizeRows <Object>] [-NoClobber] [-FreezeTopRow] [-FreezeFirstColumn] [-FreezeTopRowFirstColumn] [-FreezePane <Int32[]>] [-AutoFilter] [-BoldTopRow] [-NoHeader] [-RangeName <String>] [-TableName <Object>] [-TableStyle <TableStyles>] [-Barchart] [-PieChart] [-LineChart] [-ColumnChart] [-ExcelChartDefinition <Object[]>] [-HideSheet <String[]>] [-UnHideSheet <String[]>] [-MoveToStart] [-MoveToEnd] [-MoveBefore <Object>] [-MoveAfter <Object>] [-KillExcel] [-AutoNameRange] [-StartRow <Int32>] [-StartColumn <Int32>] [-PassThru] [-Numberformat <String>] [-ExcludeProperty <String[]>] [-NoAliasOrScriptPropeties] [-DisplayPropertySet] [-NoNumberConversion <String[]>] [-ConditionalFormat <Object[]>] [-ConditionalText <Object[]>] [-Style <Object[]>] [-CellStyleSB <ScriptBlock>] [-Activate] [-Now] [-ReturnRange] [-PivotTotals <String>] [-NoTotalsInPivot] [-ReZip] [<CommonParameters>]
```
## DESCRIPTION
This command takes a SQL statement and run it against a database connection; for the connection it accepts either
* an object representing a session with a SQL server or ODBC database, or
* a connection string to make a session (if -MSSQLServer is specified it uses the SQL Native client,
and -Connection can be a server name instead of a detailed connection string. Without this switch it uses ODBC)
* a connection string to make a session \(if -MSSQLServer is specified it uses the SQL Native client,
The command takes all the parameters of Export-Excel, except for -InputObject (alias TargetData); after fetching the data it calls Export-Excel with the data as the value of InputParameter and whichever of Export-Excel's parameters it was passed; for details of these parameters see the help for Export-Excel.
and -Connection can be a server name instead of a detailed connection string. Without this switch it uses ODBC\)
The command takes all the parameters of Export-Excel, except for -InputObject \(alias TargetData\); after fetching the data it calls Export-Excel with the data as the value of InputParameter and whichever of Export-Excel's parameters it was passed; for details of these parameters see the help for Export-Excel.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Send-SQLDataToExcel -MsSQLserver -Connection localhost -SQL "select name,type,type_desc from [master].[sys].[all_objects]" -Path .\temp.xlsx -WorkSheetname master -AutoSize -FreezeTopRow -AutoFilter -BoldTopRow
```
Connects to the local SQL server and selects 3 columns from \[Sys\].\[all_objects\] and exports then to a sheet named master with some basic header management
Connects to the local SQL server and selects 3 columns from \[Sys\].\[all\_objects\] and exports then to a sheet named master with some basic header management
### EXAMPLE 2
```
```text
PS\> $dbPath = 'C:\Users\James\Documents\Database1.accdb'
PS\> $Connection = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$dbPath;"
PS\> $SQL="SELECT top 25 Name,Length From TestData ORDER BY Length DESC"
@@ -95,7 +105,8 @@ PS\> Send-SQLDataToExcel -Connection $connection -SQL $sql -path .\demo1.xlsx -
This creates an ODBC connection string to read from an Access file and a SQL Statement to extracts data from it, and sends the resulting data to a new worksheet
### EXAMPLE 3
```
```text
PS\> $dbPath = 'C:\users\James\Documents\f1Results.xlsx'
PS\> $Connection = "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};Dbq=$dbPath;"
@@ -105,10 +116,11 @@ PS\> $SQL="SELECT top 25 DriverName, Count(RaceDate) as Races, Count(Win) as Win
PS\>Send-SQLDataToExcel -Connection $connection -SQL $sql -path .\demo2.xlsx -WorkSheetname "Winners" -AutoSize -AutoNameRange -ConditionalFormat @{DataBarColor="Blue"; Range="Wins"}
```
Similar to the previous example, this creates a connection string, this time for an Excel file, and runs a SQL statement to get a list of motor-racing results, outputting the resulting data to a new spreadsheet. The spreadsheet is formatted and a data bar added to show make the drivers' wins clearer. (The F1 results database is available from https://1drv.ms/x/s!AhfYu7-CJv4ehNdZWxJE9LMAX_N5sg )
Similar to the previous example, this creates a connection string, this time for an Excel file, and runs a SQL statement to get a list of motor-racing results, outputting the resulting data to a new spreadsheet. The spreadsheet is formatted and a data bar added to show make the drivers' wins clearer. \(The F1 results database is available from [https://1drv.ms/x/s!AhfYu7-CJv4ehNdZWxJE9LMAX\_N5sg](https://1drv.ms/x/s!AhfYu7-CJv4ehNdZWxJE9LMAX_N5sg) \)
### EXAMPLE 4
```
```text
PS\> $dbPath = 'C:\users\James\Documents\f1Results.xlsx'
PS\> $SQL = "SELECT top 25 DriverName, Count(RaceDate) as Races, Count(Win) as Wins, Count(Pole) as Poles, Count(FastestLap) as Fastlaps " +
@@ -117,30 +129,31 @@ PS\> $null = Get-SQL -Session F1 -excel -Connection $dbPath -sql $sql -OutputVar
PS\> Send-SQLDataToExcel -DataTable $Table -Path ".\demo3.xlsx" -WorkSheetname Gpwinners -autosize -TableName winners -TableStyle Light6 -show
```
This uses Get-SQL (at least V1.1 - download from the PowerShell gallery with Install-Module -Name GetSQL - (note the function is Get-SQL the module is GetSQL without the "-" )
Get-SQL simplifies making database connections and building /submitting SQL statements. Here Get-SQL uses the same SQL statement as before; -OutputVariable leaves a System.Data.DataTable object in $table and Send-SQLDataToExcel puts $table into the worksheet and sets it as an Excel table.
The command is equivalent to running
This uses Get-SQL \(at least V1.1 - download from the PowerShell gallery with Install-Module -Name GetSQL - \(note the function is Get-SQL the module is GetSQL without the "-" \)
PS\> Export-Excel -inputObject $Table -Path ".\demo3.xlsx" -WorkSheetname Gpwinners -autosize -TableName winners -TableStyle Light6 -show
Get-SQL simplifies making database connections and building /submitting SQL statements. Here Get-SQL uses the same SQL statement as before; -OutputVariable leaves a System.Data.DataTable object in $table and Send-SQLDataToExcel puts $table into the worksheet and sets it as an Excel table. The command is equivalent to running
This is quicker than using
PS\> Get-SQL \<parameters\> | export-excel -ExcludeProperty rowerror,rowstate,table,itemarray,haserrors \<parameters\>
PS&gt; Export-Excel -inputObject $Table -Path ".\demo3.xlsx" -WorkSheetname Gpwinners -autosize -TableName winners -TableStyle Light6 -show
(the F1 results database is available from https://1drv.ms/x/s!AhfYu7-CJv4ehNdZWxJE9LMAX_N5sg )
This is quicker than using PS&gt; Get-SQL \ \| export-excel -ExcludeProperty rowerror,rowstate,table,itemarray,haserrors \
\(the F1 results database is available from [https://1drv.ms/x/s!AhfYu7-CJv4ehNdZWxJE9LMAX\_N5sg](https://1drv.ms/x/s!AhfYu7-CJv4ehNdZWxJE9LMAX_N5sg) \)
### EXAMPLE 5
```
```text
PS\>$SQL = "SELECT top 25 DriverName, Count(Win) as Wins FROM Results GROUP BY DriverName ORDER BY (count(win)) DESC"
PS\> Send-SQLDataToExcel -Session $DbSessions\["f1"\] -SQL $sql -Path ".\demo3.xlsx" -WorkSheetname Gpwinners -ClearSheet -autosize -ColumnChart
```
Like the previous example, this uses Get-SQL (download from the gallery with Install-Module -Name GetSQL). It uses the database session which Get-SQL created, rather than an ODBC connection string. The Session parameter can either be a object (as shown here), or the name used by Get-SQL ("F1" in this case).
Like the previous example, this uses Get-SQL \(download from the gallery with Install-Module -Name GetSQL\). It uses the database session which Get-SQL created, rather than an ODBC connection string. The Session parameter can either be a object \(as shown here\), or the name used by Get-SQL \("F1" in this case\).
Here the data is presented as a quick chart.
### EXAMPLE 6
```
```text
Send-SQLDataToExcel -path .\demo4.xlsx -WorkSheetname "LR" -Connection "DSN=LR" -sql "SELECT name AS CollectionName FROM AgLibraryCollection Collection ORDER BY CollectionName"
```
@@ -149,9 +162,10 @@ This example uses an Existing ODBC datasource name "LR" which maps to an adobe l
## PARAMETERS
### -Connection
A database connection string to be used to create a database session; either
* A Data source name written in the form DSN=ODBC_Data_Source_Name, or
* A Data source name written in the form DSN=ODBC\_Data\_Source\_Name, or
* A full ODBC or SQL Native Client Connection string, or
* The name of a SQL server.
@@ -168,6 +182,7 @@ Accept wildcard characters: False
```
### -Session
An active ODBC Connection or SQL connection object representing a session with a database which will be queried to get the data .
```yaml
@@ -183,6 +198,7 @@ Accept wildcard characters: False
```
### -MsSQLserver
Specifies the connection string is for SQL server, not ODBC.
```yaml
@@ -198,6 +214,7 @@ Accept wildcard characters: False
```
### -DataBase
Switches to a specific database on a SQL server.
```yaml
@@ -213,6 +230,7 @@ Accept wildcard characters: False
```
### -SQL
The SQL query to run against the session which was passed in -Session or set up from -Connection.
```yaml
@@ -228,6 +246,7 @@ Accept wildcard characters: False
```
### -QueryTimeout
Override the default query time of 30 seconds.
```yaml
@@ -243,6 +262,7 @@ Accept wildcard characters: False
```
### -DataTable
A System.Data.DataTable object containing the data to be inserted into the spreadsheet without running a query. This remains supported to avoid breaking older scripts, but if you have a DataTable object you can pass the it into Export-Excel using -InputObject.
```yaml
@@ -258,6 +278,7 @@ Accept wildcard characters: False
```
### -Force
If specified Export-Excel will be called with parameters specified, even if there is no data to send
```yaml
@@ -272,9 +293,9 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -284,5 +305,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## RELATED LINKS
[Export-Excel]()
[Export-Excel](send-sqldatatoexcel.md)

View File

@@ -1,28 +1,32 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Set-ExcelColumn
## SYNOPSIS
Adds or modifies a column in an Excel worksheet, filling values, setting formatting and/or creating named ranges.
## SYNTAX
### Package
```
```text
Set-ExcelColumn -ExcelPackage <ExcelPackage> [-Worksheetname <String>] [-Column <Object>] [-StartRow <Int32>] [-Value <Object>] [-Heading <Object>] [-NumberFormat <Object>] [-BorderAround <ExcelBorderStyle>] [-FontColor <Object>] [-Bold] [-Italic] [-Underline] [-UnderLineType <ExcelUnderLineType>] [-StrikeThru] [-FontShift <ExcelVerticalAlignmentFont>] [-FontName <String>] [-FontSize <Single>] [-BackgroundColor <Object>] [-BackgroundPattern <ExcelFillStyle>] [-PatternColor <Object>] [-WrapText] [-HorizontalAlignment <ExcelHorizontalAlignment>] [-VerticalAlignment <ExcelVerticalAlignment>] [-TextRotation <Int32>] [-AutoSize] [-Width <Single>] [-AutoNameRange] [-Hide] [-Specified] [-PassThru] [<CommonParameters>]
```
### sheet
```
```text
Set-ExcelColumn -Worksheet <ExcelWorksheet> [-Column <Object>] [-StartRow <Int32>] [-Value <Object>] [-Heading <Object>] [-NumberFormat <Object>] [-BorderAround <ExcelBorderStyle>] [-FontColor <Object>] [-Bold] [-Italic] [-Underline] [-UnderLineType <ExcelUnderLineType>] [-StrikeThru] [-FontShift <ExcelVerticalAlignmentFont>] [-FontName <String>] [-FontSize <Single>] [-BackgroundColor <Object>] [-BackgroundPattern <ExcelFillStyle>] [-PatternColor <Object>] [-WrapText] [-HorizontalAlignment <ExcelHorizontalAlignment>] [-VerticalAlignment <ExcelVerticalAlignment>] [-TextRotation <Int32>] [-AutoSize] [-Width <Single>] [-AutoNameRange] [-Hide] [-Specified] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
Set-ExcelColumn can take a value which is either a string containing a value or formula or a scriptblock which evaluates to a string, and optionally a column number and fills that value down the column.
A column heading can be specified, and the column can be made a named range.
@@ -32,7 +36,8 @@ The column can be formatted in the same operation.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Set-ExcelColumn -Worksheet $ws -Column 5 -NumberFormat 'Currency'
```
@@ -43,24 +48,24 @@ Intelisense will complete the names of predefined number formats.
You can see how currency is interpreted on the local computer with the command Expand-NumberFormat currency
### EXAMPLE 2
```
```text
PS\> Set-ExcelColumn -Worksheet $ws -Heading "WinsToFastLaps" -Value {"=E$row/C$row"} -Column 7 -AutoSize -AutoNameRange
```
Here, $WS already contains a worksheet which holds counts of races won and fastest laps recorded by racing drivers (in columns C and E).
Set-ExcelColumn specifies that Column 7 should have a heading of "WinsToFastLaps" and the data cells should contain =E2/C2 , =E3/C3 etc
the new data cells should become a named range, which will also be named "WinsToFastLaps" and the column width will be set automatically.
Here, $WS already contains a worksheet which holds counts of races won and fastest laps recorded by racing drivers \(in columns C and E\). Set-ExcelColumn specifies that Column 7 should have a heading of "WinsToFastLaps" and the data cells should contain =E2/C2 , =E3/C3 etc the new data cells should become a named range, which will also be named "WinsToFastLaps" and the column width will be set automatically.
When a value begins with "=", it is treated as a formula.
If value is a script block it will be evaluated, so here the string "=E$row/C$Row" will have the number of the current row inserted; see the value parameter for a list of variables which can be used.
Note than when evaluating an expression in a string, it is necessary to wrap it in $() so $row is valid but $($row+1) is needed.
Note than when evaluating an expression in a string, it is necessary to wrap it in $\(\) so $row is valid but $\($row+1\) is needed.
To preventVariables merging into other parts of the string, use the back tick "$columnName\`4" will be "G4" - without the backtick the string will look for a variable named "columnName4"
### EXAMPLE 3
```
```text
Set-ExcelColumn -Worksheet $ws -Heading "Link" -Value {"https://en.wikipedia.org" + $worksheet.cells["B$Row"].value } -AutoSize
```
@@ -73,7 +78,8 @@ When given a valid URI, Set-ExcelColumn makes it a hyperlink.
The column will be autosized to fit the links.
### EXAMPLE 4
```
```text
4..6 | Set-ExcelColumn -Worksheet $ws -AutoNameRange
```
@@ -82,6 +88,7 @@ Again $ws contains a worksheet. Here columns 4 to 6 are made into named ranges,
## PARAMETERS
### -ExcelPackage
If specifying the worksheet by name, the ExcelPackage object which contains the worksheet also needs to be passed.
```yaml
@@ -97,6 +104,7 @@ Accept wildcard characters: False
```
### -Worksheetname
The sheet to update can be given as a name or an Excel Worksheet object - this sets it by name.
```yaml
@@ -112,6 +120,7 @@ Accept wildcard characters: False
```
### -Worksheet
This passes the worksheet object instead of passing a sheet name and an Excelpackage object.
```yaml
@@ -127,6 +136,7 @@ Accept wildcard characters: False
```
### -Column
Column to fill down - the first column is 1. 0 will be interpreted as first empty column.
```yaml
@@ -142,6 +152,7 @@ Accept wildcard characters: False
```
### -StartRow
First row to fill data in.
```yaml
@@ -157,7 +168,8 @@ Accept wildcard characters: False
```
### -Value
A value, formula or scriptblock to fill in. A script block can use $worksheet, $row, $column \[number\], $columnName \[letter(s)\], $startRow, $startColumn, $endRow, $endColumn.
A value, formula or scriptblock to fill in. A script block can use $worksheet, $row, $column \[number\], $columnName \[letter\(s\)\], $startRow, $startColumn, $endRow, $endColumn.
```yaml
Type: Object
@@ -172,6 +184,7 @@ Accept wildcard characters: False
```
### -Heading
Optional column heading.
```yaml
@@ -187,7 +200,8 @@ Accept wildcard characters: False
```
### -NumberFormat
Number format to apply to cells for example "dd/MM/yyyy HH:mm", "£#,##0.00;\[Red\]-£#,##0.00", "0.00%" , "##/##" or "0.0E+0" etc.
Number format to apply to cells for example "dd/MM/yyyy HH:mm", "£\#,\#\#0.00;\[Red\]-£\#,\#\#0.00", "0.00%" , "\#\#/\#\#" or "0.0E+0" etc.
```yaml
Type: Object
@@ -202,6 +216,7 @@ Accept wildcard characters: False
```
### -BorderAround
Style of border to draw around the row.
```yaml
@@ -218,6 +233,7 @@ Accept wildcard characters: False
```
### -FontColor
Colour for the text - if none specified it will be left as it it is.
```yaml
@@ -233,6 +249,7 @@ Accept wildcard characters: False
```
### -Bold
Make text bold; use -Bold:$false to remove bold.
```yaml
@@ -248,6 +265,7 @@ Accept wildcard characters: False
```
### -Italic
Make text italic; use -Italic:$false to remove italic.
```yaml
@@ -263,6 +281,7 @@ Accept wildcard characters: False
```
### -Underline
Underline the text using the underline style in -UnderlineType; use -Underline:$false to remove underlining.
```yaml
@@ -278,8 +297,8 @@ Accept wildcard characters: False
```
### -UnderLineType
Specifies whether underlining should be single or double, normal or accounting mode.
The default is "Single".
Specifies whether underlining should be single or double, normal or accounting mode. The default is "Single".
```yaml
Type: ExcelUnderLineType
@@ -295,6 +314,7 @@ Accept wildcard characters: False
```
### -StrikeThru
Strike through text; use -StrikeThru:$false to remove strike through.
```yaml
@@ -310,7 +330,8 @@ Accept wildcard characters: False
```
### -FontShift
Subscript or Superscript (or None).
Subscript or Superscript \(or None\).
```yaml
Type: ExcelVerticalAlignmentFont
@@ -326,6 +347,7 @@ Accept wildcard characters: False
```
### -FontName
Font to use - Excel defaults to Calibri.
```yaml
@@ -341,6 +363,7 @@ Accept wildcard characters: False
```
### -FontSize
Point size for the text.
```yaml
@@ -356,6 +379,7 @@ Accept wildcard characters: False
```
### -BackgroundColor
Change background color.
```yaml
@@ -371,6 +395,7 @@ Accept wildcard characters: False
```
### -BackgroundPattern
Background pattern - "Solid" by default.
```yaml
@@ -387,6 +412,7 @@ Accept wildcard characters: False
```
### -PatternColor
Secondary color for background pattern.
```yaml
@@ -402,6 +428,7 @@ Accept wildcard characters: False
```
### -WrapText
Turn on Text-Wrapping; use -WrapText:$false to turn off wrapping.
```yaml
@@ -417,6 +444,7 @@ Accept wildcard characters: False
```
### -HorizontalAlignment
Position cell contents to Left, Right, Center etc. Default is "General".
```yaml
@@ -433,6 +461,7 @@ Accept wildcard characters: False
```
### -VerticalAlignment
Position cell contents to Top, Bottom or Center.
```yaml
@@ -449,7 +478,8 @@ Accept wildcard characters: False
```
### -TextRotation
Degrees to rotate text; up to +90 for anti-clockwise ("upwards"), or to -90 for clockwise.
Degrees to rotate text; up to +90 for anti-clockwise \("upwards"\), or to -90 for clockwise.
```yaml
Type: Int32
@@ -464,6 +494,7 @@ Accept wildcard characters: False
```
### -AutoSize
Attempt to auto-fit cells to the width their contents.
```yaml
@@ -479,6 +510,7 @@ Accept wildcard characters: False
```
### -Width
Set cells to a fixed width, ignored if -AutoSize is specified.
```yaml
@@ -494,6 +526,7 @@ Accept wildcard characters: False
```
### -AutoNameRange
Set the inserted data to be a named range.
```yaml
@@ -509,6 +542,7 @@ Accept wildcard characters: False
```
### -Hide
Hide the column.
```yaml
@@ -524,6 +558,7 @@ Accept wildcard characters: False
```
### -Specified
If specified, returns the range of cells which were affected.
```yaml
@@ -539,6 +574,7 @@ Accept wildcard characters: False
```
### -PassThru
If specified, return an object representing the Column, to allow further work to be done on it.
```yaml
@@ -554,14 +590,18 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.ExcelColumn
### System.String
## NOTES
## RELATED LINKS

View File

@@ -1,44 +1,49 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Set-ExcelRange
## SYNOPSIS
Applies number, font, alignment and/or color formatting, values or formulas to a range of Excel cells.
## SYNTAX
```
```text
Set-ExcelRange [[-Range] <Object>] [-WorkSheet <ExcelWorksheet>] [-NumberFormat <Object>] [-BorderAround <ExcelBorderStyle>] [-BorderColor <Object>] [-BorderBottom <ExcelBorderStyle>] [-BorderTop <ExcelBorderStyle>] [-BorderLeft <ExcelBorderStyle>] [-BorderRight <ExcelBorderStyle>] [-FontColor <Object>] [-Value <Object>] [-Formula <Object>] [-ArrayFormula] [-ResetFont] [-Bold] [-Italic] [-Underline] [-UnderLineType <ExcelUnderLineType>] [-StrikeThru] [-FontShift <ExcelVerticalAlignmentFont>] [-FontName <String>] [-FontSize <Single>] [-BackgroundColor <Object>] [-BackgroundPattern <ExcelFillStyle>] [-PatternColor <Object>] [-WrapText] [-HorizontalAlignment <ExcelHorizontalAlignment>] [-VerticalAlignment <ExcelVerticalAlignment>] [-TextRotation <Int32>] [-AutoSize] [-Width <Single>] [-Height <Single>] [-Hidden] [-Locked] [-Merge] [<CommonParameters>]
```
## DESCRIPTION
Set-ExcelRange was created to set the style elements for a range of cells, this includes auto-sizing and hiding, setting font elements (Name, Size, Bold, Italic, Underline & UnderlineStyle and Subscript & SuperScript), font and background colors, borders, text wrapping, rotation, alignment within cells, and number format.
It was orignally named "Set-Format", but it has been extended to set Values, Formulas and ArrayFormulas (sometimes called Ctrl-shift-Enter \[CSE\] formulas); because of this, the name has become Set-ExcelRange but the old name of Set-Format is preserved as an alias.
Set-ExcelRange was created to set the style elements for a range of cells, this includes auto-sizing and hiding, setting font elements \(Name, Size, Bold, Italic, Underline & UnderlineStyle and Subscript & SuperScript\), font and background colors, borders, text wrapping, rotation, alignment within cells, and number format.
It was orignally named "Set-Format", but it has been extended to set Values, Formulas and ArrayFormulas \(sometimes called Ctrl-shift-Enter \[CSE\] formulas\); because of this, the name has become Set-ExcelRange but the old name of Set-Format is preserved as an alias.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $sheet.Column(3) | Set-ExcelRange -HorizontalAlignment Right -NumberFormat "#,###" -AutoFit
```
Selects column 3 from a sheet object (within a workbook object, which is a child of the ExcelPackage object) and passes it to Set-ExcelRange which formats numbers as a integers with comma-separated groups, aligns it right, and auto-fits the column to the contents.
Selects column 3 from a sheet object \(within a workbook object, which is a child of the ExcelPackage object\) and passes it to Set-ExcelRange which formats numbers as a integers with comma-separated groups, aligns it right, and auto-fits the column to the contents.
### EXAMPLE 2
```
```text
PS\> Set-ExcelRange -Range $sheet.Cells["E1:H1048576"] -HorizontalAlignment Right -NumberFormat "#,###"
```
Instead of piping the address, this version specifies a block of cells and applies similar formatting.
### EXAMPLE 3
```
```text
PS\> Set-ExcelRange $excel.Workbook.Worksheets[1].Tables["Processes"] -Italic
```
@@ -47,7 +52,8 @@ This time instead of specifying a range of cells, a table is selected by name an
## PARAMETERS
### -Range
One or more row(s), Column(s) and/or block(s) of cells to format.
One or more row\(s\), Column\(s\) and/or block\(s\) of cells to format.
```yaml
Type: Object
@@ -62,6 +68,7 @@ Accept wildcard characters: False
```
### -WorkSheet
The worksheet where the format is to be applied.
```yaml
@@ -77,7 +84,8 @@ Accept wildcard characters: False
```
### -NumberFormat
Number format to apply to cells for example "dd/MM/yyyy HH:mm", "£#,##0.00;\[Red\]-£#,##0.00", "0.00%" , "##/##" or "0.0E+0" etc.
Number format to apply to cells for example "dd/MM/yyyy HH:mm", "£\#,\#\#0.00;\[Red\]-£\#,\#\#0.00", "0.00%" , "\#\#/\#\#" or "0.0E+0" etc.
```yaml
Type: Object
@@ -92,6 +100,7 @@ Accept wildcard characters: False
```
### -BorderAround
Style of border to draw around the range.
```yaml
@@ -108,6 +117,7 @@ Accept wildcard characters: False
```
### -BorderColor
Color of the border.
```yaml
@@ -123,6 +133,7 @@ Accept wildcard characters: False
```
### -BorderBottom
Style for the bottom border.
```yaml
@@ -139,6 +150,7 @@ Accept wildcard characters: False
```
### -BorderTop
Style for the top border.
```yaml
@@ -155,6 +167,7 @@ Accept wildcard characters: False
```
### -BorderLeft
Style for the left border.
```yaml
@@ -171,6 +184,7 @@ Accept wildcard characters: False
```
### -BorderRight
Style for the right border.
```yaml
@@ -187,6 +201,7 @@ Accept wildcard characters: False
```
### -FontColor
Colour for the text - if none is specified it will be left as it is.
```yaml
@@ -202,6 +217,7 @@ Accept wildcard characters: False
```
### -Value
Value for the cell.
```yaml
@@ -217,6 +233,7 @@ Accept wildcard characters: False
```
### -Formula
Formula for the cell.
```yaml
@@ -232,7 +249,8 @@ Accept wildcard characters: False
```
### -ArrayFormula
Specifies formula should be an array formula (a.k.a CSE \[ctrl-shift-enter\] formula).
Specifies formula should be an array formula \(a.k.a CSE \[ctrl-shift-enter\] formula\).
```yaml
Type: SwitchParameter
@@ -247,6 +265,7 @@ Accept wildcard characters: False
```
### -ResetFont
Clear Bold, Italic, StrikeThrough and Underline and set color to Black.
```yaml
@@ -262,6 +281,7 @@ Accept wildcard characters: False
```
### -Bold
Make text bold; use -Bold:$false to remove bold.
```yaml
@@ -277,6 +297,7 @@ Accept wildcard characters: False
```
### -Italic
Make text italic; use -Italic:$false to remove italic.
```yaml
@@ -292,6 +313,7 @@ Accept wildcard characters: False
```
### -Underline
Underline the text using the underline style in -UnderlineType; use -Underline:$false to remove underlining.
```yaml
@@ -307,6 +329,7 @@ Accept wildcard characters: False
```
### -UnderLineType
Specifies whether underlining should be single or double, normal or accounting mode. The default is "Single".
```yaml
@@ -323,6 +346,7 @@ Accept wildcard characters: False
```
### -StrikeThru
Strike through text; use -Strikethru:$false to remove Strike through
```yaml
@@ -338,7 +362,8 @@ Accept wildcard characters: False
```
### -FontShift
Subscript or Superscript (or none).
Subscript or Superscript \(or none\).
```yaml
Type: ExcelVerticalAlignmentFont
@@ -354,6 +379,7 @@ Accept wildcard characters: False
```
### -FontName
Font to use - Excel defaults to Calibri.
```yaml
@@ -369,6 +395,7 @@ Accept wildcard characters: False
```
### -FontSize
Point size for the text.
```yaml
@@ -384,6 +411,7 @@ Accept wildcard characters: False
```
### -BackgroundColor
Change background color.
```yaml
@@ -399,6 +427,7 @@ Accept wildcard characters: False
```
### -BackgroundPattern
Background pattern - Solid by default.
```yaml
@@ -415,6 +444,7 @@ Accept wildcard characters: False
```
### -PatternColor
Secondary color for background pattern.
```yaml
@@ -430,6 +460,7 @@ Accept wildcard characters: False
```
### -WrapText
Turn on Text-Wrapping; use -WrapText:$false to turn off wrapping.
```yaml
@@ -445,8 +476,8 @@ Accept wildcard characters: False
```
### -HorizontalAlignment
Position cell contents to Left, Right, Center etc.
default is 'General'.
Position cell contents to Left, Right, Center etc. default is 'General'.
```yaml
Type: ExcelHorizontalAlignment
@@ -462,6 +493,7 @@ Accept wildcard characters: False
```
### -VerticalAlignment
Position cell contents to Top, Bottom or Center.
```yaml
@@ -478,7 +510,8 @@ Accept wildcard characters: False
```
### -TextRotation
Degrees to rotate text; up to +90 for anti-clockwise ("upwards"), or to -90 for clockwise.
Degrees to rotate text; up to +90 for anti-clockwise \("upwards"\), or to -90 for clockwise.
```yaml
Type: Int32
@@ -493,7 +526,8 @@ Accept wildcard characters: False
```
### -AutoSize
Autofit cells to width (columns or ranges only).
Autofit cells to width \(columns or ranges only\).
```yaml
Type: SwitchParameter
@@ -508,7 +542,8 @@ Accept wildcard characters: False
```
### -Width
Set cells to a fixed width (columns or ranges only), ignored if Autosize is specified.
Set cells to a fixed width \(columns or ranges only\), ignored if Autosize is specified.
```yaml
Type: Single
@@ -523,7 +558,8 @@ Accept wildcard characters: False
```
### -Height
Set cells to a fixed height (rows or ranges only).
Set cells to a fixed height \(rows or ranges only\).
```yaml
Type: Single
@@ -538,7 +574,8 @@ Accept wildcard characters: False
```
### -Hidden
Hide a row or column (not a range); use -Hidden:$false to unhide.
Hide a row or column \(not a range\); use -Hidden:$false to unhide.
```yaml
Type: SwitchParameter
@@ -553,6 +590,7 @@ Accept wildcard characters: False
```
### -Locked
Locks cells. Cells are locked by default use -locked:$false on the whole sheet and then lock specific ones, and enable protection on the sheet.
```yaml
@@ -568,6 +606,7 @@ Accept wildcard characters: False
```
### -Merge
Merges cells - it is recommended that you explicitly set -HorizontalAlignment
```yaml
@@ -583,7 +622,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -592,3 +632,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,29 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Set-ExcelRow
## SYNOPSIS
Fills values into a \[new\] row in an Excel spreadsheet, and sets row formats.
## SYNTAX
### Package
```
```text
Set-ExcelRow -ExcelPackage <ExcelPackage> [-Worksheetname <Object>] [-Row <Object>] [-StartColumn <Int32>] [-Value <Object>] [-Heading <Object>] [-HeadingBold] [-HeadingSize <Int32>] [-NumberFormat <Object>] [-BorderAround <ExcelBorderStyle>] [-BorderColor <Object>] [-BorderBottom <ExcelBorderStyle>] [-BorderTop <ExcelBorderStyle>] [-BorderLeft <ExcelBorderStyle>] [-BorderRight <ExcelBorderStyle>] [-FontColor <Object>] [-Bold] [-Italic] [-Underline] [-UnderLineType <ExcelUnderLineType>] [-StrikeThru]
[-FontShift <ExcelVerticalAlignmentFont>] [-FontName <String>] [-FontSize <Single>] [-BackgroundColor <Object>] [-BackgroundPattern <ExcelFillStyle>] [-PatternColor <Object>] [-WrapText] [-HorizontalAlignment <ExcelHorizontalAlignment>] [-VerticalAlignment <ExcelVerticalAlignment>] [-TextRotation <Int32>] [-Height <Single>] [-Hide] [-ReturnRange] [-PassThru] [<CommonParameters>]
```
### Sheet
```
```text
Set-ExcelRow -Worksheet <ExcelWorksheet> [-Row <Object>] [-StartColumn <Int32>] [-Value <Object>] [-Heading <Object>] [-HeadingBold] [-HeadingSize <Int32>] [-NumberFormat <Object>] [-BorderAround <ExcelBorderStyle>] [-BorderColor <Object>] [-BorderBottom <ExcelBorderStyle>] [-BorderTop <ExcelBorderStyle>] [-BorderLeft <ExcelBorderStyle>] [-BorderRight <ExcelBorderStyle>] [-FontColor <Object>] [-Bold] [-Italic] [-Underline] [-UnderLineType <ExcelUnderLineType>] [-StrikeThru] [-FontShift <ExcelVerticalAlignmentFont>] [-FontName <String>] [-FontSize <Single>] [-BackgroundColor <Object>] [-BackgroundPattern <ExcelFillStyle>] [-PatternColor <Object>] [-WrapText] [-HorizontalAlignment <ExcelHorizontalAlignment>] [-VerticalAlignment <ExcelVerticalAlignment>] [-TextRotation <Int32>] [-Height <Single>] [-Hide] [-ReturnRange] [-PassThru] [<CommonParameters>]
```
## DESCRIPTION
Set-ExcelRow accepts either a Worksheet object or an ExcelPackage object returned by Export-Excel and the name of a sheet, and inserts the chosen contents into a row of the sheet.
The contents can be a constant, like "42", a formula or a script block which is converted into a constant or a formula.
@@ -33,20 +37,22 @@ The first cell of the row can optionally be given a heading.
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> Set-ExcelRow -Worksheet $ws -Heading Total -Value {"=sum($columnName`2:$columnName$endrow)" }
```
$Ws contains a worksheet object, and no Row number is specified so Set-ExcelRow will select the next row after the end of the data in the sheet.
The first cell in the row will contain "Total", and each of the other cells will contain =Sum(xx2:xx99) where xx is the column name, and 99 is the last row of data.
The first cell in the row will contain "Total", and each of the other cells will contain =Sum\(xx2:xx99\) where xx is the column name, and 99 is the last row of data.
Note the use of the backtick in the script block (\`2) to Prevent 2 becoming part of the variable "ColumnName"
Note the use of the backtick in the script block \(\`2\) to Prevent 2 becoming part of the variable "ColumnName"
The script block can use $Worksheet, $Row, $Column (number), $ColumnName (letter), $StartRow/Column and $EndRow/Column.
The script block can use $Worksheet, $Row, $Column \(number\), $ColumnName \(letter\), $StartRow/Column and $EndRow/Column.
### EXAMPLE 2
```
```text
PS\> Set-ExcelRow -Worksheet $ws -Heading Total -HeadingBold -Value {"=sum($columnName`2:$columnName$endrow)" } -NumberFormat 'Currency' -StartColumn 2 -Bold -BorderTop Double -BorderBottom Thin
```
@@ -57,6 +63,7 @@ The formula and heading are set in bold face, and the formula is formatted for t
## PARAMETERS
### -ExcelPackage
An Excel package object - for example from Export-Excel -PassThru - if specified requires a sheet name to be passed a parameter.
```yaml
@@ -72,6 +79,7 @@ Accept wildcard characters: False
```
### -Worksheetname
The name of the sheet to update in the package.
```yaml
@@ -87,6 +95,7 @@ Accept wildcard characters: False
```
### -Worksheet
A worksheet object instead of passing a name and package.
```yaml
@@ -102,6 +111,7 @@ Accept wildcard characters: False
```
### -Row
Row to fill right - first row is 1. 0 will be interpreted as first unused row.
```yaml
@@ -117,6 +127,7 @@ Accept wildcard characters: False
```
### -StartColumn
Position in the row to start from.
```yaml
@@ -132,7 +143,8 @@ Accept wildcard characters: False
```
### -Value
Value, Formula or ScriptBlock to fill in. A ScriptBlock can use $worksheet, $row, $Column \[number\], $ColumnName \[letter(s)\], $startRow, $startColumn, $endRow, $endColumn.
Value, Formula or ScriptBlock to fill in. A ScriptBlock can use $worksheet, $row, $Column \[number\], $ColumnName \[letter\(s\)\], $startRow, $startColumn, $endRow, $endColumn.
```yaml
Type: Object
@@ -147,6 +159,7 @@ Accept wildcard characters: False
```
### -Heading
Optional row-heading.
```yaml
@@ -162,6 +175,7 @@ Accept wildcard characters: False
```
### -HeadingBold
Set the heading in bold type.
```yaml
@@ -177,6 +191,7 @@ Accept wildcard characters: False
```
### -HeadingSize
Change the font-size of the heading.
```yaml
@@ -192,8 +207,8 @@ Accept wildcard characters: False
```
### -NumberFormat
Number format to apply to cells e.g.
"dd/MM/yyyy HH:mm", "£#,##0.00;\[Red\]-£#,##0.00", "0.00%" , "##/##" , "0.0E+0" etc.
Number format to apply to cells e.g. "dd/MM/yyyy HH:mm", "£\#,\#\#0.00;\[Red\]-£\#,\#\#0.00", "0.00%" , "\#\#/\#\#" , "0.0E+0" etc.
```yaml
Type: Object
@@ -208,6 +223,7 @@ Accept wildcard characters: False
```
### -BorderAround
Style of border to draw around the row.
```yaml
@@ -224,6 +240,7 @@ Accept wildcard characters: False
```
### -BorderColor
Color of the border.
```yaml
@@ -239,6 +256,7 @@ Accept wildcard characters: False
```
### -BorderBottom
Style for the bottom border.
```yaml
@@ -255,6 +273,7 @@ Accept wildcard characters: False
```
### -BorderTop
Style for the top border.
```yaml
@@ -271,6 +290,7 @@ Accept wildcard characters: False
```
### -BorderLeft
Style for the left border.
```yaml
@@ -287,6 +307,7 @@ Accept wildcard characters: False
```
### -BorderRight
Style for the right border.
```yaml
@@ -303,6 +324,7 @@ Accept wildcard characters: False
```
### -FontColor
Color for the text - if not specified the font will be left as it it is.
```yaml
@@ -318,6 +340,7 @@ Accept wildcard characters: False
```
### -Bold
Make text bold; use -Bold:$false to remove bold.
```yaml
@@ -333,6 +356,7 @@ Accept wildcard characters: False
```
### -Italic
Make text italic; use -Italic:$false to remove italic.
```yaml
@@ -348,6 +372,7 @@ Accept wildcard characters: False
```
### -Underline
Underline the text using the underline style in -UnderlineType; use -Underline:$false to remove underlining.
```yaml
@@ -363,6 +388,7 @@ Accept wildcard characters: False
```
### -UnderLineType
Specifies whether underlining should be single or double, normal or accounting mode. The default is "Single".
```yaml
@@ -379,6 +405,7 @@ Accept wildcard characters: False
```
### -StrikeThru
Strike through text; use -StrikeThru:$false to remove strike through.
```yaml
@@ -394,7 +421,8 @@ Accept wildcard characters: False
```
### -FontShift
Subscript or Superscript (or none).
Subscript or Superscript \(or none\).
```yaml
Type: ExcelVerticalAlignmentFont
@@ -410,6 +438,7 @@ Accept wildcard characters: False
```
### -FontName
Font to use - Excel defaults to Calibri.
```yaml
@@ -425,6 +454,7 @@ Accept wildcard characters: False
```
### -FontSize
Point size for the text.
```yaml
@@ -440,6 +470,7 @@ Accept wildcard characters: False
```
### -BackgroundColor
Change background color.
```yaml
@@ -455,6 +486,7 @@ Accept wildcard characters: False
```
### -BackgroundPattern
Background pattern - solid by default.
```yaml
@@ -471,6 +503,7 @@ Accept wildcard characters: False
```
### -PatternColor
Secondary color for background pattern.
```yaml
@@ -486,6 +519,7 @@ Accept wildcard characters: False
```
### -WrapText
Turn on Text-Wrapping; use -WrapText:$false to turn off wrapping.
```yaml
@@ -501,8 +535,8 @@ Accept wildcard characters: False
```
### -HorizontalAlignment
Position cell contents to Left, Right, Center etc.
default is 'General'.
Position cell contents to Left, Right, Center etc. default is 'General'.
```yaml
Type: ExcelHorizontalAlignment
@@ -518,6 +552,7 @@ Accept wildcard characters: False
```
### -VerticalAlignment
Position cell contents to Top, Bottom or Center.
```yaml
@@ -534,7 +569,8 @@ Accept wildcard characters: False
```
### -TextRotation
Degrees to rotate text. Up to +90 for anti-clockwise ("upwards"), or to -90 for clockwise.
Degrees to rotate text. Up to +90 for anti-clockwise \("upwards"\), or to -90 for clockwise.
```yaml
Type: Int32
@@ -549,6 +585,7 @@ Accept wildcard characters: False
```
### -Height
Set cells to a fixed height.
```yaml
@@ -564,6 +601,7 @@ Accept wildcard characters: False
```
### -Hide
Hide the row.
```yaml
@@ -579,6 +617,7 @@ Accept wildcard characters: False
```
### -ReturnRange
If sepecified, returns the range of cells which were affected.
```yaml
@@ -594,6 +633,7 @@ Accept wildcard characters: False
```
### -PassThru
If Specified, return a row object to allow further work to be done.
```yaml
@@ -609,14 +649,18 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
## OUTPUTS
### OfficeOpenXml.ExcelRow
### System.String
## NOTES
## RELATED LINKS

View File

@@ -1,21 +1,24 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Update-FirstObjectProperties
## SYNOPSIS
Updates the first object to contain all the properties of the object with the most properties in the array.
## SYNTAX
```
```text
Update-FirstObjectProperties
```
## DESCRIPTION
Updates the first object to contain all the properties found anywhere in the array.
This is usefull when not all objects have the same quantity of properties and CmdLets like Out-GridView or Export-Excel are not able to show all the properties because the first object doesn't have them all.
@@ -23,7 +26,8 @@ This is usefull when not all objects have the same quantity of properties and Cm
## EXAMPLES
### EXAMPLE 1
```
```text
PS\> $Array = @()
PS\> $Obj1 = [PSCustomObject]@{
Member1 = 'First'
@@ -48,7 +52,8 @@ PS\> $Array | Update-FirstObjectProperties | Out-GridView -Title 'All properties
Updates the first object of the array by adding Member3 and Member4 and shows before and after in gridviews
### EXAMPLE 2
```
```text
PS\>$ExcelParams = @{
Path = $env:TEMP + '\Excel.xlsx'
Show = $true
@@ -85,8 +90,8 @@ Updates the first object of the array by adding property 'Member3' and 'Member4'
## OUTPUTS
## NOTES
CHANGELOG
2017/06/08 Function born
CHANGELOG 2017/06/08 Function born
## RELATED LINKS

2
pivot/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Pivot

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Pivot
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Pivot [[-targetData] <Object>] [[-pivotRows] <Object>] [[-pivotData] <Object>] [[-ChartType] <eChartType>]
[<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ChartType
{{ Fill ChartType Description }}
```yaml
Type: eChartType
@@ -48,7 +44,6 @@ Accept wildcard characters: False
```
### -pivotData
{{ Fill pivotData Description }}
```yaml
Type: Object
@@ -63,7 +58,6 @@ Accept wildcard characters: False
```
### -pivotRows
{{ Fill pivotRows Description }}
```yaml
Type: Object
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -targetData
{{ Fill targetData Description }}
```yaml
Type: Object
@@ -93,7 +86,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -102,6 +96,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

2
public/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Public

View File

@@ -1,51 +1,51 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# ConvertFrom-ExcelData
## SYNOPSIS
Reads data from a sheet, and for each row, calls a custom scriptblock with a list of property names and the row of data.
## SYNTAX
```
```text
ConvertFrom-ExcelData [-Path] <Object> [[-ScriptBlock] <ScriptBlock>] [[-WorksheetName] <Object>]
[[-HeaderRow] <Int32>] [[-Header] <String[]>] [-NoHeader] [-DataOnly] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### EXAMPLE 1
```
```text
ConvertFrom-ExcelData .\testSQLGen.xlsx {
```
param($propertyNames, $record)
param\($propertyNames, $record\)
$reportRecord = @()
foreach ($pn in $propertyNames) {
```text
$reportRecord = @()
foreach ($pn in $propertyNames) {
$reportRecord += "{0}: {1}" -f $pn, $record.$pn
}
$reportRecord +=""
$reportRecord -join "\`r\`n"
}
$reportRecord +=""
$reportRecord -join "\`r\`n"
```
}
First: John
Last: Doe
The Zip: 12345
....
First: John Last: Doe The Zip: 12345 ....
## PARAMETERS
### -Path
{{ Fill Path Description }}
```yaml
Type: Object
@@ -60,7 +60,6 @@ Accept wildcard characters: False
```
### -ScriptBlock
{{ Fill ScriptBlock Description }}
```yaml
Type: ScriptBlock
@@ -75,7 +74,6 @@ Accept wildcard characters: False
```
### -WorksheetName
{{ Fill WorksheetName Description }}
```yaml
Type: Object
@@ -90,7 +88,6 @@ Accept wildcard characters: False
```
### -HeaderRow
{{ Fill HeaderRow Description }}
```yaml
Type: Int32
@@ -105,7 +102,6 @@ Accept wildcard characters: False
```
### -Header
{{ Fill Header Description }}
```yaml
Type: String[]
@@ -120,7 +116,6 @@ Accept wildcard characters: False
```
### -NoHeader
{{ Fill NoHeader Description }}
```yaml
Type: SwitchParameter
@@ -135,7 +130,6 @@ Accept wildcard characters: False
```
### -DataOnly
{{ Fill DataOnly Description }}
```yaml
Type: SwitchParameter
@@ -150,7 +144,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -159,3 +154,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,35 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# ConvertTo-ExcelXlsx
## SYNOPSIS
Converts an Excel xls to a xlsx using -ComObject
## SYNTAX
```
```text
ConvertTo-ExcelXlsx [-Path] <String> [-Force] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -Path
{{ Fill Path Description }}
```yaml
Type: String
@@ -46,7 +44,6 @@ Accept wildcard characters: False
```
### -Force
{{ Fill Force Description }}
```yaml
Type: SwitchParameter
@@ -61,7 +58,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -70,3 +68,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Get-ExcelColumnName
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Get-ExcelColumnName [[-ColumnNumber] <Object>] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ColumnNumber
{{ Fill ColumnNumber Description }}
```yaml
Type: Object
@@ -46,7 +42,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -55,6 +52,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Get-HtmlTable
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Get-HtmlTable [-Url] <Object> [[-TableIndex] <Object>] [[-Header] <Object>] [[-FirstDataRow] <Int32>]
[-UseDefaultCredentials] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -FirstDataRow
{{ Fill FirstDataRow Description }}
```yaml
Type: Int32
@@ -47,7 +43,6 @@ Accept wildcard characters: False
```
### -Header
{{ Fill Header Description }}
```yaml
Type: Object
@@ -62,7 +57,6 @@ Accept wildcard characters: False
```
### -UseDefaultCredentials
{{ Fill UseDefaultCredentials Description }}
```yaml
Type: SwitchParameter
@@ -77,7 +71,6 @@ Accept wildcard characters: False
```
### -TableIndex
{{ Fill TableIndex Description }}
```yaml
Type: Object
@@ -92,7 +85,6 @@ Accept wildcard characters: False
```
### -Url
{{ Fill Url Description }}
```yaml
Type: Object
@@ -107,7 +99,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -116,6 +109,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Get-Range
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Get-Range [[-Start] <Object>] [[-Stop] <Object>] [[-Step] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -start
{{ Fill start Description }}
```yaml
Type: Object
@@ -46,7 +42,6 @@ Accept wildcard characters: False
```
### -Step
{{ Fill Step Description }}
```yaml
Type: Object
@@ -61,7 +56,6 @@ Accept wildcard characters: False
```
### -stop
{{ Fill stop Description }}
```yaml
Type: Object
@@ -82,6 +76,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Get-XYRange
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Get-XYRange [[-TargetData] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -TargetData
{{ Fill TargetData Description }}
```yaml
Type: Object
@@ -52,6 +48,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Import-Html
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Import-Html [[-Url] <Object>] [[-Index] <Object>] [[-Header] <Object>] [[-FirstDataRow] <Int32>]
[-UseDefaultCredentials] [<CommonParameters>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -FirstDataRow
{{ Fill FirstDataRow Description }}
```yaml
Type: Int32
@@ -47,7 +43,6 @@ Accept wildcard characters: False
```
### -Header
{{ Fill Header Description }}
```yaml
Type: Object
@@ -62,7 +57,6 @@ Accept wildcard characters: False
```
### -UseDefaultCredentials
{{ Fill UseDefaultCredentials Description }}
```yaml
Type: SwitchParameter
@@ -77,7 +71,6 @@ Accept wildcard characters: False
```
### -Index
{{ Fill Index Description }}
```yaml
Type: Object
@@ -92,7 +85,6 @@ Accept wildcard characters: False
```
### -Url
{{ Fill Url Description }}
```yaml
Type: Object
@@ -107,7 +99,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -116,6 +109,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Import-UPS
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Import-UPS [[-TrackingNumber] <Object>] [-UseDefaultCredentials]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -TrackingNumber
{{ Fill TrackingNumber Description }}
```yaml
Type: Object
@@ -46,7 +42,6 @@ Accept wildcard characters: False
```
### -UseDefaultCredentials
{{ Fill UseDefaultCredentials Description }}
```yaml
Type: SwitchParameter
@@ -67,6 +62,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Import-USPS
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Import-USPS [[-TrackingNumber] <Object>] [-UseDefaultCredentials]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -TrackingNumber
{{ Fill TrackingNumber Description }}
```yaml
Type: Object
@@ -46,7 +42,6 @@ Accept wildcard characters: False
```
### -UseDefaultCredentials
{{ Fill UseDefaultCredentials Description }}
```yaml
Type: SwitchParameter
@@ -67,6 +62,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,37 +1,33 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version: https://github.com/dfinke/ImportExcel
online version: 'https://github.com/dfinke/ImportExcel'
schema: 2.0.0
---
# Invoke-Sum
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Invoke-Sum [[-Data] <Object>] [[-Dimension] <Object>] [[-Measure] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -Data
{{ Fill Data Description }}
```yaml
Type: Object
@@ -46,7 +42,6 @@ Accept wildcard characters: False
```
### -Dimension
{{ Fill Dimension Description }}
```yaml
Type: Object
@@ -61,7 +56,6 @@ Accept wildcard characters: False
```
### -Measure
{{ Fill Measure Description }}
```yaml
Type: Object
@@ -82,6 +76,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,18 +1,17 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-ExcelStyle
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
New-ExcelStyle [[-Range] <Object>] [[-NumberFormat] <Object>] [[-BorderAround] <ExcelBorderStyle>]
[[-BorderColor] <Object>] [[-BorderBottom] <ExcelBorderStyle>] [[-BorderTop] <ExcelBorderStyle>]
[[-BorderLeft] <ExcelBorderStyle>] [[-BorderRight] <ExcelBorderStyle>] [[-FontColor] <Object>]
@@ -25,21 +24,18 @@ New-ExcelStyle [[-Range] <Object>] [[-NumberFormat] <Object>] [[-BorderAround] <
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -ArrayFormula
{{ Fill ArrayFormula Description }}
```yaml
Type: SwitchParameter
@@ -54,7 +50,6 @@ Accept wildcard characters: False
```
### -AutoSize
{{ Fill AutoSize Description }}
```yaml
Type: SwitchParameter
@@ -69,7 +64,6 @@ Accept wildcard characters: False
```
### -BackgroundColor
{{ Fill BackgroundColor Description }}
```yaml
Type: Object
@@ -84,7 +78,6 @@ Accept wildcard characters: False
```
### -BackgroundPattern
{{ Fill BackgroundPattern Description }}
```yaml
Type: ExcelFillStyle
@@ -100,7 +93,6 @@ Accept wildcard characters: False
```
### -Bold
{{ Fill Bold Description }}
```yaml
Type: SwitchParameter
@@ -115,7 +107,6 @@ Accept wildcard characters: False
```
### -BorderAround
{{ Fill BorderAround Description }}
```yaml
Type: ExcelBorderStyle
@@ -131,7 +122,6 @@ Accept wildcard characters: False
```
### -BorderBottom
{{ Fill BorderBottom Description }}
```yaml
Type: ExcelBorderStyle
@@ -147,7 +137,6 @@ Accept wildcard characters: False
```
### -BorderColor
{{ Fill BorderColor Description }}
```yaml
Type: Object
@@ -162,7 +151,6 @@ Accept wildcard characters: False
```
### -BorderLeft
{{ Fill BorderLeft Description }}
```yaml
Type: ExcelBorderStyle
@@ -178,7 +166,6 @@ Accept wildcard characters: False
```
### -BorderRight
{{ Fill BorderRight Description }}
```yaml
Type: ExcelBorderStyle
@@ -194,7 +181,6 @@ Accept wildcard characters: False
```
### -BorderTop
{{ Fill BorderTop Description }}
```yaml
Type: ExcelBorderStyle
@@ -210,7 +196,6 @@ Accept wildcard characters: False
```
### -FontColor
{{ Fill FontColor Description }}
```yaml
Type: Object
@@ -225,7 +210,6 @@ Accept wildcard characters: False
```
### -FontName
{{ Fill FontName Description }}
```yaml
Type: String
@@ -240,7 +224,6 @@ Accept wildcard characters: False
```
### -FontShift
{{ Fill FontShift Description }}
```yaml
Type: ExcelVerticalAlignmentFont
@@ -256,7 +239,6 @@ Accept wildcard characters: False
```
### -FontSize
{{ Fill FontSize Description }}
```yaml
Type: Single
@@ -271,7 +253,6 @@ Accept wildcard characters: False
```
### -Formula
{{ Fill Formula Description }}
```yaml
Type: Object
@@ -286,7 +267,6 @@ Accept wildcard characters: False
```
### -Height
{{ Fill Height Description }}
```yaml
Type: Single
@@ -301,7 +281,6 @@ Accept wildcard characters: False
```
### -Hidden
{{ Fill Hidden Description }}
```yaml
Type: SwitchParameter
@@ -316,7 +295,6 @@ Accept wildcard characters: False
```
### -HorizontalAlignment
{{ Fill HorizontalAlignment Description }}
```yaml
Type: ExcelHorizontalAlignment
@@ -332,7 +310,6 @@ Accept wildcard characters: False
```
### -Italic
{{ Fill Italic Description }}
```yaml
Type: SwitchParameter
@@ -347,7 +324,6 @@ Accept wildcard characters: False
```
### -Locked
{{ Fill Locked Description }}
```yaml
Type: SwitchParameter
@@ -362,7 +338,6 @@ Accept wildcard characters: False
```
### -Merge
{{ Fill Merge Description }}
```yaml
Type: SwitchParameter
@@ -377,7 +352,6 @@ Accept wildcard characters: False
```
### -NumberFormat
{{ Fill NumberFormat Description }}
```yaml
Type: Object
@@ -392,7 +366,6 @@ Accept wildcard characters: False
```
### -PatternColor
{{ Fill PatternColor Description }}
```yaml
Type: Object
@@ -407,7 +380,6 @@ Accept wildcard characters: False
```
### -Range
{{ Fill Range Description }}
```yaml
Type: Object
@@ -422,7 +394,6 @@ Accept wildcard characters: False
```
### -ResetFont
{{ Fill ResetFont Description }}
```yaml
Type: SwitchParameter
@@ -437,7 +408,6 @@ Accept wildcard characters: False
```
### -StrikeThru
{{ Fill StrikeThru Description }}
```yaml
Type: SwitchParameter
@@ -452,7 +422,6 @@ Accept wildcard characters: False
```
### -TextRotation
{{ Fill TextRotation Description }}
```yaml
Type: Int32
@@ -467,7 +436,6 @@ Accept wildcard characters: False
```
### -UnderLineType
{{ Fill UnderLineType Description }}
```yaml
Type: ExcelUnderLineType
@@ -483,7 +451,6 @@ Accept wildcard characters: False
```
### -Underline
{{ Fill Underline Description }}
```yaml
Type: SwitchParameter
@@ -498,7 +465,6 @@ Accept wildcard characters: False
```
### -Value
{{ Fill Value Description }}
```yaml
Type: Object
@@ -513,7 +479,6 @@ Accept wildcard characters: False
```
### -VerticalAlignment
{{ Fill VerticalAlignment Description }}
```yaml
Type: ExcelVerticalAlignment
@@ -529,7 +494,6 @@ Accept wildcard characters: False
```
### -Width
{{ Fill Width Description }}
```yaml
Type: Single
@@ -544,7 +508,6 @@ Accept wildcard characters: False
```
### -WrapText
{{ Fill WrapText Description }}
```yaml
Type: SwitchParameter
@@ -565,6 +528,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,33 +1,30 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-Plot
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
New-Plot
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
## INPUTS
@@ -37,6 +34,8 @@ PS C:\> {{ Add example code here }}
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,33 +1,30 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# New-PSItem
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
New-PSItem
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
## INPUTS
@@ -37,6 +34,8 @@ PS C:\> {{ Add example code here }}
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,38 +1,34 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Set-CellStyle
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Set-CellStyle [[-Worksheet] <Object>] [[-Row] <Object>] [[-LastColumn] <Object>] [[-Pattern] <ExcelFillStyle>]
[[-Color] <Object>]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -Color
{{ Fill Color Description }}
```yaml
Type: Object
@@ -47,7 +43,6 @@ Accept wildcard characters: False
```
### -LastColumn
{{ Fill LastColumn Description }}
```yaml
Type: Object
@@ -62,7 +57,6 @@ Accept wildcard characters: False
```
### -Pattern
{{ Fill Pattern Description }}
```yaml
Type: ExcelFillStyle
@@ -78,7 +72,6 @@ Accept wildcard characters: False
```
### -Row
{{ Fill Row Description }}
```yaml
Type: Object
@@ -93,7 +86,6 @@ Accept wildcard characters: False
```
### -Worksheet
{{ Fill Worksheet Description }}
```yaml
Type: Object
@@ -114,6 +106,8 @@ Accept wildcard characters: False
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

View File

@@ -1,18 +1,17 @@
---
external help file: ImportExcel-help.xml
Module Name: ImportExcel
online version:
online version: null
schema: 2.0.0
---
# Set-WorksheetProtection
## SYNOPSIS
{{ Fill in the Synopsis }}
## SYNTAX
```
```text
Set-WorksheetProtection [-Worksheet] <ExcelWorksheet> [-IsProtected] [-AllowAll] [-BlockSelectLockedCells]
[-BlockSelectUnlockedCells] [-AllowFormatCells] [-AllowFormatColumns] [-AllowFormatRows] [-AllowInsertColumns]
[-AllowInsertRows] [-AllowInsertHyperlinks] [-AllowDeleteColumns] [-AllowDeleteRows] [-AllowSort]
@@ -21,21 +20,18 @@ Set-WorksheetProtection [-Worksheet] <ExcelWorksheet> [-IsProtected] [-AllowAll]
```
## DESCRIPTION
{{ Fill in the Description }}
## EXAMPLES
### Example 1
```powershell
```text
PS C:\> {{ Add example code here }}
```
{{ Add example description here }}
## PARAMETERS
### -AllowAll
{{ Fill AllowAll Description }}
```yaml
Type: SwitchParameter
@@ -50,7 +46,6 @@ Accept wildcard characters: False
```
### -AllowAutoFilter
{{ Fill AllowAutoFilter Description }}
```yaml
Type: SwitchParameter
@@ -65,7 +60,6 @@ Accept wildcard characters: False
```
### -AllowDeleteColumns
{{ Fill AllowDeleteColumns Description }}
```yaml
Type: SwitchParameter
@@ -80,7 +74,6 @@ Accept wildcard characters: False
```
### -AllowDeleteRows
{{ Fill AllowDeleteRows Description }}
```yaml
Type: SwitchParameter
@@ -95,7 +88,6 @@ Accept wildcard characters: False
```
### -AllowFormatCells
{{ Fill AllowFormatCells Description }}
```yaml
Type: SwitchParameter
@@ -110,7 +102,6 @@ Accept wildcard characters: False
```
### -AllowFormatColumns
{{ Fill AllowFormatColumns Description }}
```yaml
Type: SwitchParameter
@@ -125,7 +116,6 @@ Accept wildcard characters: False
```
### -AllowFormatRows
{{ Fill AllowFormatRows Description }}
```yaml
Type: SwitchParameter
@@ -140,7 +130,6 @@ Accept wildcard characters: False
```
### -AllowInsertColumns
{{ Fill AllowInsertColumns Description }}
```yaml
Type: SwitchParameter
@@ -155,7 +144,6 @@ Accept wildcard characters: False
```
### -AllowInsertHyperlinks
{{ Fill AllowInsertHyperlinks Description }}
```yaml
Type: SwitchParameter
@@ -170,7 +158,6 @@ Accept wildcard characters: False
```
### -AllowInsertRows
{{ Fill AllowInsertRows Description }}
```yaml
Type: SwitchParameter
@@ -185,7 +172,6 @@ Accept wildcard characters: False
```
### -AllowPivotTables
{{ Fill AllowPivotTables Description }}
```yaml
Type: SwitchParameter
@@ -200,7 +186,6 @@ Accept wildcard characters: False
```
### -AllowSort
{{ Fill AllowSort Description }}
```yaml
Type: SwitchParameter
@@ -215,7 +200,6 @@ Accept wildcard characters: False
```
### -BlockEditObject
{{ Fill BlockEditObject Description }}
```yaml
Type: SwitchParameter
@@ -230,7 +214,6 @@ Accept wildcard characters: False
```
### -BlockEditScenarios
{{ Fill BlockEditScenarios Description }}
```yaml
Type: SwitchParameter
@@ -245,7 +228,6 @@ Accept wildcard characters: False
```
### -BlockSelectLockedCells
{{ Fill BlockSelectLockedCells Description }}
```yaml
Type: SwitchParameter
@@ -260,7 +242,6 @@ Accept wildcard characters: False
```
### -BlockSelectUnlockedCells
{{ Fill BlockSelectUnlockedCells Description }}
```yaml
Type: SwitchParameter
@@ -275,7 +256,6 @@ Accept wildcard characters: False
```
### -IsProtected
{{ Fill IsProtected Description }}
```yaml
Type: SwitchParameter
@@ -290,7 +270,6 @@ Accept wildcard characters: False
```
### -LockAddress
{{ Fill LockAddress Description }}
```yaml
Type: String
@@ -305,7 +284,6 @@ Accept wildcard characters: False
```
### -UnLockAddress
{{ Fill UnLockAddress Description }}
```yaml
Type: String
@@ -320,7 +298,6 @@ Accept wildcard characters: False
```
### -Worksheet
{{ Fill Worksheet Description }}
```yaml
Type: ExcelWorksheet
@@ -335,7 +312,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
@@ -344,6 +322,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS