Files
ImportExcel/Examples/Tables/TotalsRow.ps1
Thomas Hofkens 4c0e7970cf Updated Examples
2022-11-12 00:26:40 +01:00

16 lines
583 B
PowerShell

try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
$r = Get-ChildItem C:\WINDOWS\system32 -File
$TotalSettings = @{
Name = "Count"
# You can create the formula in an Excel workbook first and copy-paste it here
# This syntax can only be used for the Custom type
Extension = "=COUNTIF([Extension];`".exe`")"
Length = @{
Function = "=SUMIF([Extension];`".exe`";[Length])"
Comment = "Sum of all exe sizes"
}
}
$r | Export-Excel -TableName system32files -TableStyle Medium10 -TableTotalSettings $TotalSettings -Show