plugins/ezout/formats/Services.format.ps1xml
<?xml version="1.0" encoding="utf-16"?>
<Configuration> <ViewDefinitions> <View> <Name>System.ServiceProcess.ServiceController</Name> <ViewSelectedBy> <TypeName>System.ServiceProcess.ServiceController</TypeName> </ViewSelectedBy> <TableControl> <AutoSize /> <TableHeaders> <TableColumnHeader> <Label>Status</Label> </TableColumnHeader> <TableColumnHeader> <Label>Name</Label> </TableColumnHeader> <TableColumnHeader> <Label>DisplayName</Label> </TableColumnHeader> </TableHeaders> <TableRowEntries> <TableRowEntry> <TableColumnItems> <TableColumnItem> <ScriptBlock> $status = $_.Status if ($OMPPansiesModuleLoaded -and ($null -ne (get-variable OMPEZOutDefinitions)) -and $OMPConsoleHasANSI -and $Global:OMPEzOutPluginLoaded) { $revertcolor = New-Text -Object "" -ForegroundColor ((Get-OMPHostState).foreground) -ErrorAction:SilentlyContinue switch ($status) { 'Stopped' { $statusout = New-Text -Object $status -Foregroundcolor $Global:OMPEZOutDefinitions['Service'].Stopped['Color'] } 'Running' { $statusout = New-Text -Object $status -Foregroundcolor $Global:OMPEZOutDefinitions['Service'].Running['Color'] } 'Starting' { $statusout = New-Text -Object $status -Foregroundcolor $Global:OMPEZOutDefinitions['Service'].Starting['Color'] } Default { $statusout = New-Text -Object $status -Foregroundcolor $Global:OMPEZOutDefinitions['Service'].Default['Color'] } } # Pansies likes to reset the default color to white for some reason, this resets the color correctly. [string]$finaloutput = $statusout.ToString() + $revertcolor.ToString() # + "$([char](27))[0m" $finaloutput } else { $status } </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> $_.Name </ScriptBlock> </TableColumnItem> <TableColumnItem> <ScriptBlock> $_.DisplayName </ScriptBlock> </TableColumnItem> </TableColumnItems> </TableRowEntry> </TableRowEntries> </TableControl> </View> </ViewDefinitions> </Configuration> |