mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-26 13:13:16 +00:00
Move help from Comment-based to md. Relocate functions (sans help)
This commit is contained in:
16
ExportedCommands/Set-CellStyle.ps1
Normal file
16
ExportedCommands/Set-CellStyle.ps1
Normal file
@@ -0,0 +1,16 @@
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='Set*', Justification='Does not change system state')]
|
||||
param()
|
||||
|
||||
function Set-CellStyle {
|
||||
param(
|
||||
$WorkSheet,
|
||||
$Row,
|
||||
$LastColumn,
|
||||
[OfficeOpenXml.Style.ExcelFillStyle]$Pattern,
|
||||
$Color
|
||||
)
|
||||
if ($Color -is [string]) {$Color = [System.Drawing.Color]::$Color }
|
||||
$t=$WorkSheet.Cells["A$($Row):$($LastColumn)$($Row)"]
|
||||
$t.Style.Fill.PatternType=$Pattern
|
||||
$t.Style.Fill.BackgroundColor.SetColor($Color)
|
||||
}
|
||||
Reference in New Issue
Block a user