Added try/catch

This commit is contained in:
dfinke
2018-07-04 18:58:40 -04:00
parent 35553baa05
commit b591a4ab18
17 changed files with 84 additions and 51 deletions

View File

@@ -1,11 +1,13 @@
$file = ".\conditionalTextFormatting.xlsx"
rm $file -ErrorAction Ignore
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
Get-Service |
Select Status, Name, DisplayName, ServiceName |
$file = ".\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
New-ConditionalText stop
New-ConditionalText runn darkblue cyan
New-ConditionalText -ConditionalType EndsWith svc wheat green
New-ConditionalText -ConditionalType BeginsWith windows darkgreen wheat
New-ConditionalText -ConditionalType EndsWith svc wheat green
New-ConditionalText -ConditionalType BeginsWith windows darkgreen wheat
)