From 08155c25f5f2182e623cdd3eb6b94ac09a52e4a4 Mon Sep 17 00:00:00 2001 From: jhoneill Date: Thu, 12 Jul 2018 20:26:37 +0100 Subject: [PATCH] Merged two Join Worksheet sample directories --- .../Join-Worksheet.sample.ps1 | 14 +++++++------- .../Join-worksheet-blocks.sample.ps1 | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) rename Examples/{Join-Worksheet => JoinWorksheet}/Join-Worksheet.sample.ps1 (87%) rename Examples/{Join-Worksheet => JoinWorksheet}/Join-worksheet-blocks.sample.ps1 (90%) diff --git a/Examples/Join-Worksheet/Join-Worksheet.sample.ps1 b/Examples/JoinWorksheet/Join-Worksheet.sample.ps1 similarity index 87% rename from Examples/Join-Worksheet/Join-Worksheet.sample.ps1 rename to Examples/JoinWorksheet/Join-Worksheet.sample.ps1 index ca81895..94ba68f 100644 --- a/Examples/Join-Worksheet/Join-Worksheet.sample.ps1 +++ b/Examples/JoinWorksheet/Join-Worksheet.sample.ps1 @@ -1,8 +1,8 @@ -#Get rid of pre-exisiting sheet +#Get rid of pre-exisiting sheet $path = "$Env:TEMP\test.xlsx" remove-item -Path $path -ErrorAction SilentlyContinue -#Create simple pages for 3 stores with product ID, Product Name, quanity price and total +#Create simple pages for 3 stores with product ID, Product Name, quanity price and total @" ID,Product,Quantity,Price,Total @@ -31,13 +31,13 @@ ID,Product,Quantity,Price,Total 12012,Pliers,3,14.99,44.97 "@ | ConvertFrom-Csv| Export-Excel -Path $path -WorkSheetname Banbury -#define a pivot table with a chart to show a sales by store, broken down by product +#define a pivot table with a chart to show a sales by store, broken down by product $ptdef = New-PivotTableDefinition -PivotTableName "Summary" -PivotRows "Store" -PivotColumns "Product" -PivotData @{"Total"="SUM"} -IncludePivotChart -ChartTitle "Sales Breakdown" -ChartType ColumnStacked -ChartColumn 10 -#Join the 3 worksheets. +#Join the 3 worksheets. #Name the combined page "Total" and Name the column with the sheet names "store" (as the sheets 'Oxford','Abingdon' and 'Banbury' are the names of the stores -#Format the data as a table named "Summary", using the style "Light1", put the column headers in bold +#Format the data as a table named "Summary", using the style "Light1", put the column headers in bold #Put in a title and freeze to top of the sheet including title and colmun headings -#Add the Pivot table. +#Add the Pivot table. #Show the result -Join-Worksheet -Path $path -WorkSheetName "Total" -Clearsheet -FromLabel "Store" -TableName "Summary" -TableStyle Light1 -AutoSize -BoldTopRow -FreezePane 2,1 -Title "Store Sales Summary" -TitleBold -TitleSize 14 -PivotTableDefinition $ptdef -show +Join-Worksheet -Path $path -WorkSheetName "Total" -Clearsheet -FromLabel "Store" -TableName "Summary" -TableStyle Light1 -AutoSize -BoldTopRow -FreezePane 2,1 -Title "Store Sales Summary" -TitleBold -TitleSize 14 -PivotTableDefinition $ptdef -show diff --git a/Examples/Join-Worksheet/Join-worksheet-blocks.sample.ps1 b/Examples/JoinWorksheet/Join-worksheet-blocks.sample.ps1 similarity index 90% rename from Examples/Join-Worksheet/Join-worksheet-blocks.sample.ps1 rename to Examples/JoinWorksheet/Join-worksheet-blocks.sample.ps1 index 81976f4..5ee0506 100644 --- a/Examples/Join-Worksheet/Join-worksheet-blocks.sample.ps1 +++ b/Examples/JoinWorksheet/Join-worksheet-blocks.sample.ps1 @@ -2,10 +2,10 @@ $path = "$env:TEMP\Test.xlsx" Remove-item -Path $path -ErrorAction SilentlyContinue Get-WmiObject -Class win32_logicaldisk | - Select-Object -Property DeviceId,VolumeName, Size,Freespace | + Select-Object -Property DeviceId,VolumeName, Size,Freespace | Export-Excel -Path $path -WorkSheetname Volumes -NumberFormat "0,000" -Get-NetAdapter | - Select-Object -Property Name,InterfaceDescription,MacAddress,LinkSpeed | +Get-NetAdapter | + Select-Object -Property Name,InterfaceDescription,MacAddress,LinkSpeed | Export-Excel -Path $path -WorkSheetname NetAdapters -Join-Worksheet -Path $path -HideSource -WorkSheetName Summary -NoHeader -LabelBlocks -AutoSize -Title "Summary" -TitleBold -TitleSize 22 -show +Join-Worksheet -Path $path -HideSource -WorkSheetName Summary -NoHeader -LabelBlocks -AutoSize -Title "Summary" -TitleBold -TitleSize 22 -show