forked from dfinke/ImportExcel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConditionalText.ps1
More file actions
13 lines (11 loc) · 1.02 KB
/
Copy pathConditionalText.ps1
File metadata and controls
13 lines (11 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
$file = "$env:temp\conditionalTextFormatting.xlsx"
Remove-Item $file -ErrorAction Ignore
Get-Service |
Select-Object Status, Name, DisplayName, ServiceName |
Export-Excel $file -Show -AutoSize -AutoFilter -ConditionalText $(
New-ConditionalText stop #Stop is the condition value, the rule is defaults to 'Contains text' and the default Colors are used
New-ConditionalText runn darkblue cyan #runn is the condition value, the rule is defaults to 'Contains text'; the foregroundColur is darkblue and the background is cyan
New-ConditionalText -ConditionalType EndsWith svc wheat green #the rule here is 'Ends with' and the value is 'svc' the forground is wheat and the background dark green
New-ConditionalText -ConditionalType BeginsWith windows darkgreen wheat #this is 'Begins with "Windows"' the forground is dark green and the background wheat
)