diff --git a/Public/Add-PivotTable.ps1 b/Public/Add-PivotTable.ps1 index ba339eb..1b3f967 100644 --- a/Public/Add-PivotTable.ps1 +++ b/Public/Add-PivotTable.ps1 @@ -7,7 +7,7 @@ [OfficeOpenXml.ExcelAddressBase] $Address, $ExcelPackage, - $SourceWorkSheet, + $SourceWorksheet, $SourceRange, $PivotRows, $PivotData, @@ -75,11 +75,11 @@ if (-not $wsPivot.PivotTables[$pivotTableName] ) { try { #Accept a string or a worksheet object as $SourceWorksheet - we don't need a worksheet if we have a Rangebase . - if ( $SourceWorkSheet -is [string]) { - $SourceWorkSheet = $ExcelPackage.Workbook.Worksheets.where( {$_.name -Like $SourceWorkSheet})[0] + if ( $SourceWorksheet -is [string]) { + $SourceWorksheet = $ExcelPackage.Workbook.Worksheets.where( {$_.name -Like $SourceWorksheet})[0] } - elseif ( $SourceWorkSheet -is [int] ) { - $SourceWorkSheet = $ExcelPackage.Workbook.Worksheets[$SourceWorkSheet] + elseif ( $SourceWorksheet -is [int] ) { + $SourceWorksheet = $ExcelPackage.Workbook.Worksheets[$SourceWorksheet] } if ( $SourceRange -is [OfficeOpenXml.Table.ExcelTable]) {$SourceRange = $SourceRange.Address } if ( $sourceRange -is [OfficeOpenXml.ExcelRange] -or @@ -87,13 +87,13 @@ $pivotTable = $wsPivot.PivotTables.Add($Address, $SourceRange, $pivotTableName) } elseif (-not $SourceRange) { - $pivotTable = $wsPivot.PivotTables.Add($Address, $SourceWorkSheet.cells[$SourceWorkSheet.Dimension.Address], $pivotTableName) + $pivotTable = $wsPivot.PivotTables.Add($Address, $SourceWorksheet.cells[$SourceWorksheet.Dimension.Address], $pivotTableName) } - elseif ($SourceWorkSheet -isnot [OfficeOpenXml.ExcelWorksheet] ) { + elseif ($SourceWorksheet -isnot [OfficeOpenXml.ExcelWorksheet] ) { Write-Warning -Message "Could not find source Worksheet for pivot-table '$pivotTableName'." ; return } elseif ( $SourceRange -is [String] -or $SourceRange -is [OfficeOpenXml.ExcelAddress]) { - $pivotTable = $wsPivot.PivotTables.Add($Address, $SourceWorkSheet.Cells[$SourceRange], $pivotTableName) + $pivotTable = $wsPivot.PivotTables.Add($Address, $SourceWorksheet.Cells[$SourceRange], $pivotTableName) } else {Write-warning "Could not create a PivotTable with the Source Range provided."; return} foreach ($row in $PivotRows) { @@ -150,8 +150,8 @@ else { Write-Warning -Message "PivotTable defined in $($pivotTableName) already exists, only the data range will be changed." $pivotTable = $wsPivot.PivotTables[$pivotTableName] - if (-not $SourceRange) { $SourceRange = $SourceWorkSheet.Dimension.Address} - $pivotTable.CacheDefinition.SourceRange = $SourceWorkSheet.cells[$SourceRange] + if (-not $SourceRange) { $SourceRange = $SourceWorksheet.Dimension.Address} + $pivotTable.CacheDefinition.SourceRange = $SourceWorksheet.cells[$SourceRange] #change for epPlus 4.5 - Previously needed to hack the xml # $pivotTable.CacheDefinition.CacheDefinitionXml.pivotCacheDefinition.cacheSource.worksheetSource.ref = $SourceRange diff --git a/Public/Add-Worksheet.ps1 b/Public/Add-Worksheet.ps1 index 0a025ab..429e3aa 100644 --- a/Public/Add-Worksheet.ps1 +++ b/Public/Add-Worksheet.ps1 @@ -4,7 +4,7 @@ function Add-Worksheet { param( [Parameter(Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Package", Position = 0)] [OfficeOpenXml.ExcelPackage]$ExcelPackage, - [Parameter(Mandatory = $true, ParameterSetName = "WorkBook")] + [Parameter(Mandatory = $true, ParameterSetName = "Workbook")] [OfficeOpenXml.ExcelWorkbook]$ExcelWorkbook, [string]$WorksheetName , [switch]$ClearSheet, diff --git a/Public/Convert-ExcelRangeToImage.ps1 b/Public/Convert-ExcelRangeToImage.ps1 index 12e2b6d..71be251 100644 --- a/Public/Convert-ExcelRangeToImage.ps1 +++ b/Public/Convert-ExcelRangeToImage.ps1 @@ -40,7 +40,7 @@ $worksheetName = 'Processes' $Path = "$pwd\demo.xlsx" $myData = Get-Process | Select-Object -Property Name,WS,CPU,Description,company,startTime -$excelPackage = $myData | Export-Excel -KillExcel -Path $Path -WorkSheetname $worksheetName -ClearSheet -AutoSize -AutoFilter -BoldTopRow -FreezeTopRow -PassThru +$excelPackage = $myData | Export-Excel -KillExcel -Path $Path -WorksheetName $worksheetName -ClearSheet -AutoSize -AutoFilter -BoldTopRow -FreezeTopRow -PassThru $worksheet = $excelPackage.Workbook.Worksheets[$worksheetName] $range = $worksheet.Dimension.Address Set-ExcelRange -Worksheet $worksheet -Range "b:b" -NumberFormat "#,###" -AutoFit diff --git a/Public/ConvertFrom-ExcelData.md b/Public/ConvertFrom-ExcelData.md index 95a8520..b594cbe 100644 --- a/Public/ConvertFrom-ExcelData.md +++ b/Public/ConvertFrom-ExcelData.md @@ -13,7 +13,7 @@ Reads data from a sheet, and for each row, calls a custom scriptblock with a lis ## SYNTAX ``` -ConvertFrom-ExcelData [-Path] [[-scriptBlock] ] [[-WorkSheetname] ] +ConvertFrom-ExcelData [-Path] [[-ScriptBlock] ] [[-WorksheetName] ] [[-HeaderRow] ] [[-Header] ] [-NoHeader] [-DataOnly] [] ``` @@ -59,8 +59,8 @@ Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` -### -scriptBlock -{{ Fill scriptBlock Description }} +### -ScriptBlock +{{ Fill ScriptBlock Description }} ```yaml Type: ScriptBlock @@ -74,8 +74,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WorkSheetname -{{ Fill WorkSheetname Description }} +### -WorksheetName +{{ Fill WorksheetName Description }} ```yaml Type: Object diff --git a/Public/ConvertFrom-ExcelData.ps1 b/Public/ConvertFrom-ExcelData.ps1 index 15a195f..a85f147 100644 --- a/Public/ConvertFrom-ExcelData.ps1 +++ b/Public/ConvertFrom-ExcelData.ps1 @@ -5,7 +5,7 @@ function ConvertFrom-ExcelData { [Parameter(ValueFromPipelineByPropertyName = $true, ValueFromPipeline = $true, Mandatory = $true)] [ValidateScript( { Test-Path $_ -PathType Leaf })] $Path, - [ScriptBlock]$scriptBlock, + [ScriptBlock]$ScriptBlock, [Alias("Sheet")] $WorksheetName = 1, [int]$HeaderRow = 1, @@ -14,7 +14,7 @@ function ConvertFrom-ExcelData { [switch]$DataOnly ) - $null = $PSBoundParameters.Remove('scriptBlock') + $null = $PSBoundParameters.Remove('ScriptBlock') $params = @{} + $PSBoundParameters $data = Import-Excel @params @@ -24,6 +24,6 @@ function ConvertFrom-ExcelData { Select-Object -ExpandProperty name foreach ($record in $data) { - & $scriptBlock $PropertyNames $record + & $ScriptBlock $PropertyNames $record } } \ No newline at end of file diff --git a/Public/ConvertFrom-ExcelToSQLInsert.ps1 b/Public/ConvertFrom-ExcelToSQLInsert.ps1 index a1a31e0..b468d8b 100644 --- a/Public/ConvertFrom-ExcelToSQLInsert.ps1 +++ b/Public/ConvertFrom-ExcelToSQLInsert.ps1 @@ -16,12 +16,12 @@ function ConvertFrom-ExcelToSQLInsert { [switch]$NoHeader, [switch]$DataOnly, [switch]$ConvertEmptyStringsToNull, - [switch]$UseMSSQLSyntax + [switch]$UseMsSqlSyntax ) $null = $PSBoundParameters.Remove('TableName') $null = $PSBoundParameters.Remove('ConvertEmptyStringsToNull') - $null = $PSBoundParameters.Remove('UseMSSQLSyntax') + $null = $PSBoundParameters.Remove('UseMsSqlSyntax') $params = @{} + $PSBoundParameters @@ -29,7 +29,7 @@ function ConvertFrom-ExcelToSQLInsert { param($propertyNames, $record) $ColumnNames = "'" + ($PropertyNames -join "', '") + "'" - if($UseMSSQLSyntax) { + if($UseMsSqlSyntax) { $ColumnNames = "[" + ($PropertyNames -join "], [") + "]" } diff --git a/Public/Copy-ExcelWorksheet.ps1 b/Public/Copy-ExcelWorksheet.ps1 index 6a22547..26e0635 100644 --- a/Public/Copy-ExcelWorksheet.ps1 +++ b/Public/Copy-ExcelWorksheet.ps1 @@ -4,7 +4,7 @@ [Parameter(Mandatory = $true,ValueFromPipeline=$true)] [Alias('SourceWorkbook')] $SourceObject, - $SourceWorkSheet = 1 , + $SourceWorksheet = 1 , [Parameter(Mandatory = $true)] $DestinationWorkbook, $DestinationWorksheet, @@ -39,7 +39,7 @@ return } else { - $null = Add-Worksheet -ExcelPackage $excel -WorkSheetname $DestinationWorksheet -CopySource ($excel.Workbook.Worksheets[$SourceWorkSheet]) + $null = Add-Worksheet -ExcelPackage $excel -WorksheetName $DestinationWorksheet -CopySource ($excel.Workbook.Worksheets[$SourceWorksheet]) Close-ExcelPackage -ExcelPackage $excel -Show:$Show return } @@ -47,15 +47,15 @@ } else { if ($SourceObject -is [OfficeOpenXml.ExcelWorksheet]) {$sourceWs = $SourceObject} - elseif ($SourceObject -is [OfficeOpenXml.ExcelWorkbook]) {$sourceWs = $SourceObject.Worksheets[$SourceWorkSheet]} - elseif ($SourceObject -is [OfficeOpenXml.ExcelPackage] ) {$sourceWs = $SourceObject.Workbook.Worksheets[$SourceWorkSheet]} + elseif ($SourceObject -is [OfficeOpenXml.ExcelWorkbook]) {$sourceWs = $SourceObject.Worksheets[$SourceWorksheet]} + elseif ($SourceObject -is [OfficeOpenXml.ExcelPackage] ) {$sourceWs = $SourceObject.Workbook.Worksheets[$SourceWorksheet]} else { $SourceObject = (Resolve-Path $SourceObject).ProviderPath try { Write-Verbose "Opening worksheet '$WorksheetName' in Excel workbook '$SourceObject'." $stream = New-Object -TypeName System.IO.FileStream -ArgumentList $SourceObject, 'Open', 'Read' , 'ReadWrite' $package1 = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream - $sourceWs = $Package1.Workbook.Worksheets[$SourceWorkSheet] + $sourceWs = $Package1.Workbook.Worksheets[$SourceWorksheets] } catch {Write-Warning -Message "Could not open $SourceObject - the error was '$($_.exception.message)' " ; return} } @@ -76,7 +76,7 @@ $DestinationWorkbook.Worksheets.Delete($DestinationWorksheet) } Write-Verbose "Copying '$($sourcews.name)' from $($SourceObject) to '$($DestinationWorksheet)' in $($PSBoundParameters['DestinationWorkbook'])" - $null = Add-Worksheet -ExcelWorkbook $DestinationWorkbook -WorkSheetname $DestinationWorksheet -CopySource $sourceWs + $null = Add-Worksheet -ExcelWorkbook $DestinationWorkbook -WorksheetName $DestinationWorksheet -CopySource $sourceWs #Leave the destination open but close the source - if we're copying more than one sheet we'll re-open it and live with the inefficiency if ($stream) {$stream.Close() } if ($package1) {Close-ExcelPackage -ExcelPackage $package1 -NoSave } diff --git a/Public/Export-Excel.ps1 b/Public/Export-Excel.ps1 index d9649cc..40e41f2 100644 --- a/Public/Export-Excel.ps1 +++ b/Public/Export-Excel.ps1 @@ -435,8 +435,8 @@ $params = $item.value if ($Activate) {$params.Activate = $true } if ($params.keys -notcontains 'SourceRange' -and - ($params.Keys -notcontains 'SourceWorkSheet' -or $params.SourceWorkSheet -eq $WorksheetName)) {$params.SourceRange = $dataRange} - if ($params.Keys -notcontains 'SourceWorkSheet') {$params.SourceWorkSheet = $ws } + ($params.Keys -notcontains 'SourceWorksheet' -or $params.SourceWorksheet -eq $WorksheetName)) {$params.SourceRange = $dataRange} + if ($params.Keys -notcontains 'SourceWorksheet') {$params.SourceWorksheet = $ws } if ($params.Keys -notcontains 'NoTotalsInPivot' -and $NoTotalsInPivot ) {$params.PivotTotals = 'None'} if ($params.Keys -notcontains 'PivotTotals' -and $PivotTotals ) {$params.PivotTotals = $PivotTotals} if ($params.Keys -notcontains 'PivotDataToColumn' -and $PivotDataToColumn) {$params.PivotDataToColumn = $true} @@ -471,7 +471,7 @@ if ($ShowPercent) {$params.ShowPercent = $true} if ($NoLegend) {$params.NoLegend = $true} } - Add-PivotTable -ExcelPackage $pkg -SourceWorkSheet $ws @params + Add-PivotTable -ExcelPackage $pkg -SourceWorksheet $ws @params } try { @@ -544,7 +544,7 @@ foreach ($Sheet in $HideSheet) { try { - $pkg.Workbook.WorkSheets.Where({$_.Name -like $sheet}) | ForEach-Object { + $pkg.Workbook.Worksheets.Where({$_.Name -like $sheet}) | ForEach-Object { $_.Hidden = 'Hidden' Write-verbose -Message "Sheet '$($_.Name)' Hidden." } @@ -553,7 +553,7 @@ } foreach ($Sheet in $UnHideSheet) { try { - $pkg.Workbook.WorkSheets.Where({$_.Name -like $sheet}) | ForEach-Object { + $pkg.Workbook.Worksheets.Where({$_.Name -like $sheet}) | ForEach-Object { $_.Hidden = 'Visible' Write-verbose -Message "Sheet '$($_.Name)' shown" } diff --git a/Public/Get-ExcelColumnName.md b/Public/Get-ExcelColumnName.md index 85a891f..f0d33e2 100644 --- a/Public/Get-ExcelColumnName.md +++ b/Public/Get-ExcelColumnName.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Get-ExcelColumnName [[-columnNumber] ] [] +Get-ExcelColumnName [[-ColumnNumber] ] [] ``` ## DESCRIPTION @@ -30,8 +30,8 @@ PS C:\> {{ Add example code here }} ## PARAMETERS -### -columnNumber -{{ Fill columnNumber Description }} +### -ColumnNumber +{{ Fill ColumnNumber Description }} ```yaml Type: Object diff --git a/Public/Get-ExcelColumnName.ps1 b/Public/Get-ExcelColumnName.ps1 index d2f6a86..239dcfb 100644 --- a/Public/Get-ExcelColumnName.ps1 +++ b/Public/Get-ExcelColumnName.ps1 @@ -1,11 +1,11 @@ function Get-ExcelColumnName { param( [Parameter(ValueFromPipeline=$true)] - $columnNumber=1 + $ColumnNumber=1 ) Process { - $dividend = $columnNumber + $dividend = $ColumnNumber $columnName = New-Object System.Collections.ArrayList($null) while($dividend -gt 0) { @@ -19,7 +19,7 @@ function Get-ExcelColumnName { } [PSCustomObject] @{ - ColumnNumber = $columnNumber + ColumnNumber = $ColumnNumber ColumnName = $columnName -join '' } diff --git a/Public/Get-HtmlTable.md b/Public/Get-HtmlTable.md index 7fe2d1a..2945b95 100644 --- a/Public/Get-HtmlTable.md +++ b/Public/Get-HtmlTable.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Get-HtmlTable [-url] [[-tableIndex] ] [[-Header] ] [[-FirstDataRow] ] +Get-HtmlTable [-Url] [[-TableIndex] ] [[-Header] ] [[-FirstDataRow] ] [-UseDefaultCredentials] [] ``` @@ -76,8 +76,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -tableIndex -{{ Fill tableIndex Description }} +### -TableIndex +{{ Fill TableIndex Description }} ```yaml Type: Object @@ -91,8 +91,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -url -{{ Fill url Description }} +### -Url +{{ Fill Url Description }} ```yaml Type: Object diff --git a/Public/Get-HtmlTable.ps1 b/Public/Get-HtmlTable.ps1 index 3aefbb3..b613a98 100644 --- a/Public/Get-HtmlTable.ps1 +++ b/Public/Get-HtmlTable.ps1 @@ -3,16 +3,16 @@ function Get-HtmlTable { param( [Parameter(Mandatory=$true)] - $url, - $tableIndex=0, + $Url, + $TableIndex=0, $Header, [int]$FirstDataRow=0, [Switch]$UseDefaultCredentials ) - $r = Invoke-WebRequest $url -UseDefaultCredentials: $UseDefaultCredentials + $r = Invoke-WebRequest $Url -UseDefaultCredentials: $UseDefaultCredentials - $table = $r.ParsedHtml.getElementsByTagName("table")[$tableIndex] + $table = $r.ParsedHtml.getElementsByTagName("table")[$TableIndex] $propertyNames=$Header $totalRows=@($table.rows).count diff --git a/Public/Get-Range.md b/Public/Get-Range.md index 9d37398..553292d 100644 --- a/Public/Get-Range.md +++ b/Public/Get-Range.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Get-Range [[-start] ] [[-stop] ] [[-step] ] +Get-Range [[-Start] ] [[-Stop] ] [[-Step] ] ``` ## DESCRIPTION @@ -45,8 +45,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -step -{{ Fill step Description }} +### -Step +{{ Fill Step Description }} ```yaml Type: Object diff --git a/Public/Get-Range.ps1 b/Public/Get-Range.ps1 index d127afb..0ebfab6 100644 --- a/Public/Get-Range.ps1 +++ b/Public/Get-Range.ps1 @@ -1,5 +1,5 @@ function Get-Range { [CmdletBinding()] - param($start=0,$stop,$step=1) - for ($idx = $start; $idx -lt $stop; $idx+=$step) {$idx} + param($Start=0,$Stop,$Step=1) + for ($idx = $Start; $idx -lt $Stop; $idx+=$Step) {$idx} } \ No newline at end of file diff --git a/Public/Get-XYRange.md b/Public/Get-XYRange.md index 3d0af44..46b7214 100644 --- a/Public/Get-XYRange.md +++ b/Public/Get-XYRange.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Get-XYRange [[-targetData] ] +Get-XYRange [[-TargetData] ] ``` ## DESCRIPTION @@ -30,8 +30,8 @@ PS C:\> {{ Add example code here }} ## PARAMETERS -### -targetData -{{ Fill targetData Description }} +### -TargetData +{{ Fill TargetData Description }} ```yaml Type: Object diff --git a/Public/Get-XYRange.ps1 b/Public/Get-XYRange.ps1 index 734d263..3237333 100644 --- a/Public/Get-XYRange.ps1 +++ b/Public/Get-XYRange.ps1 @@ -1,8 +1,8 @@ function Get-XYRange { [CmdletBinding()] - param($targetData) + param($TargetData) - $record = $targetData | Select-Object -First 1 + $record = $TargetData | Select-Object -First 1 $p=$record.psobject.Properties.name $infer = for ($idx = 0; $idx -lt $p.Count; $idx++) { diff --git a/Public/Import-Html.md b/Public/Import-Html.md index 91725a4..029f341 100644 --- a/Public/Import-Html.md +++ b/Public/Import-Html.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Import-Html [[-url] ] [[-index] ] [[-Header] ] [[-FirstDataRow] ] +Import-Html [[-Url] ] [[-Index] ] [[-Header] ] [[-FirstDataRow] ] [-UseDefaultCredentials] [] ``` @@ -76,8 +76,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -index -{{ Fill index Description }} +### -Index +{{ Fill Index Description }} ```yaml Type: Object @@ -91,8 +91,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -url -{{ Fill url Description }} +### -Url +{{ Fill Url Description }} ```yaml Type: Object diff --git a/Public/Import-Html.ps1 b/Public/Import-Html.ps1 index 2deadcc..5c0b020 100644 --- a/Public/Import-Html.ps1 +++ b/Public/Import-Html.ps1 @@ -2,8 +2,8 @@ function Import-Html { [CmdletBinding()] param( - $url, - $index, + $Url, + $Index, $Header, [int]$FirstDataRow=0, [Switch]$UseDefaultCredentials @@ -14,7 +14,7 @@ function Import-Html { Write-Verbose "Exporting to Excel file $($xlFile)" - $data = Get-HtmlTable -url $url -tableIndex $index -Header $Header -FirstDataRow $FirstDataRow -UseDefaultCredentials: $UseDefaultCredentials + $data = Get-HtmlTable -Url $Url -TableIndex $Index -Header $Header -FirstDataRow $FirstDataRow -UseDefaultCredentials: $UseDefaultCredentials $data | Export-Excel $xlFile -Show -AutoSize } \ No newline at end of file diff --git a/Public/Invoke-Sum.md b/Public/Invoke-Sum.md index efbb46e..cb032fa 100644 --- a/Public/Invoke-Sum.md +++ b/Public/Invoke-Sum.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Invoke-Sum [[-data] ] [[-dimension] ] [[-measure] ] +Invoke-Sum [[-Data] ] [[-Dimension] ] [[-Measure] ] ``` ## DESCRIPTION @@ -30,8 +30,8 @@ PS C:\> {{ Add example code here }} ## PARAMETERS -### -data -{{ Fill data Description }} +### -Data +{{ Fill Data Description }} ```yaml Type: Object @@ -45,8 +45,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -dimension -{{ Fill dimension Description }} +### -Dimension +{{ Fill Dimension Description }} ```yaml Type: Object @@ -60,8 +60,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -measure -{{ Fill measure Description }} +### -Measure +{{ Fill Measure Description }} ```yaml Type: Object diff --git a/Public/Invoke-Sum.ps1 b/Public/Invoke-Sum.ps1 index 8f6a3f3..6787adb 100644 --- a/Public/Invoke-Sum.ps1 +++ b/Public/Invoke-Sum.ps1 @@ -1,17 +1,17 @@ function Invoke-Sum { [CmdletBinding()] param( - $data, - $dimension, - $measure + $Data, + $Dimension, + $Measure ) - if(!$measure) {$measure = $dimension} + if(!$Measure) {$Measure = $Dimension} $h=@{} - foreach ($item in $data){ - $key=$item.$dimension + foreach ($item in $Data){ + $key=$item.$Dimension if(!$key) {$key="[missing]"} @@ -19,7 +19,7 @@ function Invoke-Sum { $h.$key=[ordered]@{} } - foreach($m in $measure) { + foreach($m in $Measure) { $value = $item.$m if($value -is [string] -or $value -is [System.Enum]) { $value = 1 diff --git a/Public/Join-Worksheet.ps1 b/Public/Join-Worksheet.ps1 index 3645a8a..e5c5820 100644 --- a/Public/Join-Worksheet.ps1 +++ b/Public/Join-Worksheet.ps1 @@ -55,7 +55,7 @@ ) #region get target worksheet, select it and move it to the end. if ($Path -and -not $ExcelPackage) {$ExcelPackage = Open-ExcelPackage -path $Path } - $destinationSheet = Add-Worksheet -ExcelPackage $ExcelPackage -WorkSheetname $WorksheetName -ClearSheet:$Clearsheet + $destinationSheet = Add-Worksheet -ExcelPackage $ExcelPackage -WorksheetName $WorksheetName -ClearSheet:$Clearsheet foreach ($w in $ExcelPackage.Workbook.Worksheets) {$w.view.TabSelected = $false} $destinationSheet.View.TabSelected = $true $ExcelPackage.Workbook.Worksheets.MoveToEnd($WorksheetName) @@ -123,7 +123,7 @@ 'Title', 'TitleFillPattern', 'TitleBackgroundColor', 'TitleBold', 'TitleSize' | ForEach-Object {$null = $params.Remove($_)} if ($params.Keys.Count) { if ($Title) { $params.StartRow = 2} - $params.WorkSheetName = $WorksheetName + $params.WorksheetName = $WorksheetName $params.ExcelPackage = $ExcelPackage Export-Excel @Params } diff --git a/Public/Merge-MultipleSheets.ps1 b/Public/Merge-MultipleSheets.ps1 index 85965ed..acbfe7a 100644 --- a/Public/Merge-MultipleSheets.ps1 +++ b/Public/Merge-MultipleSheets.ps1 @@ -75,7 +75,7 @@ $orderByProperties = $merged[0].psobject.properties.where({$_.name -match "row$"}).name Write-Progress -Activity "Merging sheets" -CurrentOperation "creating output sheet '$OutputSheetName' in $OutputFile" $excel = $merged | Sort-Object -Property $orderByProperties | - Export-Excel -Path $OutputFile -Worksheetname $OutputSheetName -ClearSheet -BoldTopRow -AutoFilter -PassThru + Export-Excel -Path $OutputFile -WorksheetName $OutputSheetName -ClearSheet -BoldTopRow -AutoFilter -PassThru $sheet = $excel.Workbook.Worksheets[$OutputSheetName] #We will put in a conditional format for "if all the others are not flagged as 'same'" to mark rows where something is added, removed or changed diff --git a/Public/Merge-Worksheet.ps1 b/Public/Merge-Worksheet.ps1 index bc22526..4347061 100644 --- a/Public/Merge-Worksheet.ps1 +++ b/Public/Merge-Worksheet.ps1 @@ -233,7 +233,7 @@ elseif ($PSCmdlet.ShouldProcess($OutputFile,"Write Output to Excel file")) { $expandedDiff = $expandedDiff | Sort-Object -Property "_row", "$DiffPrefix Row" $xl = $expandedDiff | Select-Object -Property $OutputProps | Update-FirstObjectProperties | - Export-Excel -Path $OutputFile -Worksheetname $OutputSheetName -FreezeTopRow -BoldTopRow -AutoSize -AutoFilter -PassThru + Export-Excel -Path $OutputFile -WorksheetName $OutputSheetName -FreezeTopRow -BoldTopRow -AutoSize -AutoFilter -PassThru $ws = $xl.Workbook.Worksheets[$OutputSheetName] for ($i = 0; $i -lt $expandedDiff.Count; $i++ ) { if ( $expandedDiff[$i].side -ne "==" ) { diff --git a/Public/New-PivotTableDefinition.ps1 b/Public/New-PivotTableDefinition.ps1 index 6916bc5..884579e 100644 --- a/Public/New-PivotTableDefinition.ps1 +++ b/Public/New-PivotTableDefinition.ps1 @@ -5,7 +5,7 @@ function New-PivotTableDefinition { [Parameter(Mandatory)] [Alias("PivtoTableName")]#Previous typo - use alias to avoid breaking scripts $PivotTableName, - $SourceWorkSheet, + $SourceWorksheet, $SourceRange, $PivotRows, [hashtable]$PivotData, diff --git a/Public/Send-SQLDataToExcel.ps1 b/Public/Send-SQLDataToExcel.ps1 index bdf6d3c..28121c9 100644 --- a/Public/Send-SQLDataToExcel.ps1 +++ b/Public/Send-SQLDataToExcel.ps1 @@ -9,7 +9,7 @@ [Parameter(ParameterSetName="ExistingSession", Mandatory=$true)] $Session, [Parameter(ParameterSetName="SQLConnection", Mandatory=$true)] - [switch]$MsSQLserver, + [switch]$MsSqlServer, [Parameter(ParameterSetName="SQLConnection")] [String]$DataBase, [Parameter(ParameterSetName="SQLConnection", Mandatory=$true)] @@ -46,10 +46,10 @@ $null = $PSBoundParameters.Remove('AutoFilter') } #endregion - #region if we were either given a session object or a connection string (& optionally -MSSQLServer) make sure we can connect + #region if we were either given a session object or a connection string (& optionally -MsSqlServer) make sure we can connect try { - #If we got -MSSQLServer, create a SQL connection, if we didn't but we got -Connection create an ODBC connection - if ($MsSQLserver -and $Connection) { + #If we got -MsSqlServer, create a SQL connection, if we didn't but we got -Connection create an ODBC connection + if ($MsSqlServer -and $Connection) { if ($Connection -notmatch '=') {$Connection = "server=$Connection;trusted_connection=true;timeout=60"} $Session = New-Object -TypeName System.Data.SqlClient.SqlConnection -ArgumentList $Connection if ($Session.State -ne 'Open') {$Session.Open()} @@ -90,7 +90,7 @@ #endregion #region send the table to Excel #remove parameters which relate to querying SQL, leaving the ones used by Export-Excel - 'Connection' , 'Database' , 'Session' , 'MsSQLserver' , 'SQL' , 'DataTable' , 'QueryTimeout' , 'Force' | + 'Connection' , 'Database' , 'Session' , 'MsSqlServer' , 'SQL' , 'DataTable' , 'QueryTimeout' , 'Force' | ForEach-Object {$null = $PSBoundParameters.Remove($_) } #if force was specified export even if there are no rows. If there are no columns, the query failed and export "null" if forced if ($DataTable.Rows.Count) { diff --git a/Public/Set-CellStyle.md b/Public/Set-CellStyle.md index c312af2..843c956 100644 --- a/Public/Set-CellStyle.md +++ b/Public/Set-CellStyle.md @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Set-CellStyle [[-WorkSheet] ] [[-Row] ] [[-LastColumn] ] [[-Pattern] ] +Set-CellStyle [[-Worksheet] ] [[-Row] ] [[-LastColumn] ] [[-Pattern] ] [[-Color] ] ``` @@ -92,8 +92,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WorkSheet -{{ Fill WorkSheet Description }} +### -Worksheet +{{ Fill Worksheet Description }} ```yaml Type: Object diff --git a/Public/Set-WorksheetProtection.md b/Public/Set-WorksheetProtection.md index ec1c389..345f6f0 100644 --- a/Public/Set-WorksheetProtection.md +++ b/Public/Set-WorksheetProtection.md @@ -5,7 +5,7 @@ online version: schema: 2.0.0 --- -# Set-WorkSheetProtection +# Set-WorksheetProtection ## SYNOPSIS {{ Fill in the Synopsis }} @@ -13,7 +13,7 @@ schema: 2.0.0 ## SYNTAX ``` -Set-WorkSheetProtection [-WorkSheet] [-IsProtected] [-AllowAll] [-BlockSelectLockedCells] +Set-WorksheetProtection [-Worksheet] [-IsProtected] [-AllowAll] [-BlockSelectLockedCells] [-BlockSelectUnlockedCells] [-AllowFormatCells] [-AllowFormatColumns] [-AllowFormatRows] [-AllowInsertColumns] [-AllowInsertRows] [-AllowInsertHyperlinks] [-AllowDeleteColumns] [-AllowDeleteRows] [-AllowSort] [-AllowAutoFilter] [-AllowPivotTables] [-BlockEditObject] [-BlockEditScenarios] [[-LockAddress] ] @@ -319,8 +319,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WorkSheet -{{ Fill WorkSheet Description }} +### -Worksheet +{{ Fill Worksheet Description }} ```yaml Type: ExcelWorksheet