Added Examples for Get-Help

This commit is contained in:
Doug Finke
2015-04-10 14:42:24 -04:00
parent ca2dfd7d6c
commit 08418e3455
3 changed files with 12 additions and 2 deletions

View File

@@ -46,6 +46,14 @@ function Import-Excel {
function Export-Excel { function Export-Excel {
<# <#
.Synopsis .Synopsis
.Example
gsv | Export-Excel .\test.xlsx
.Example
ps | Export-Excel .\test.xlsx -show\
.Example
ps | Export-Excel .\test.xlsx -WorkSheetname Processes -IncludePivotTable -Show -PivotRows Company -PivotData PM
.Example
ps | Export-Excel .\test.xlsx -WorkSheetname Processes -ChartType PieExploded3D -IncludePivotChart -IncludePivotTable -Show -PivotRows Company -PivotData PM
#> #>
param( param(
[Parameter(Mandatory)] [Parameter(Mandatory)]
@@ -119,7 +127,7 @@ function Export-Excel {
if($IncludePivotTable) { if($IncludePivotTable) {
$pivotTableName = $WorkSheetname + "PivotTable" $pivotTableName = $WorkSheetname + "PivotTable"
$wsPivot = $pkg.Workbook.Worksheets.Add($pivotTableName) $wsPivot = $pkg.Workbook.Worksheets.Add($pivotTableName)
#$wsPivot.View.TabSelected = $true $wsPivot.View.TabSelected = $true
$pivotTableDataName=$WorkSheetname + "PivotTableData" $pivotTableDataName=$WorkSheetname + "PivotTableData"
$range="{0}:{1}" -f $ws.Dimension.Start.Address, $ws.Dimension.End.Address $range="{0}:{1}" -f $ws.Dimension.Start.Address, $ws.Dimension.End.Address

View File

@@ -16,7 +16,9 @@ What's new
* Renamed `AutoFitColumns` to `AutoSize` * Renamed `AutoFitColumns` to `AutoSize`
* Implemented `Export-MultipleExcelSheets` * Implemented `Export-MultipleExcelSheets`
* Implemented `-Password` for a worksheet * Implemented `-Password` for a worksheet
* Replaced `-Force` switch with `-NoClobber` switch * Replaced `-Force` switch with `-NoClobber` switch
* Added examples for `Get-Help
* If Pivot table is requested, that sheet becomes the tab selected
#### Examples #### Examples
`gsv | Export-Excel .\test.xlsx -WorkSheetname Services` `gsv | Export-Excel .\test.xlsx -WorkSheetname Services`

BIN
test.xlsx Normal file

Binary file not shown.