Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <Configuration>
- <SelectionSets>
- <SelectionSet>
- <Name>ServiceControllerTypes</Name>
- <Types>
- <TypeName>System.ServiceProcess.ServiceController</TypeName>
- </Types>
- </SelectionSet>
- </SelectionSets>
- <ViewDefinitions>
- <View>
- <Name>services</Name>
- <ViewSelectedBy>
- <SelectionSetName>ServiceControllerTypes</SelectionSetName>
- </ViewSelectedBy>
- <TableControl>
- <TableHeaders>
- <TableColumnHeader>
- <Label>Status</Label>
- <Alignment>right</Alignment>
- </TableColumnHeader>
- <TableColumnHeader>
- <Label>StartType</Label>
- <Alignment>right</Alignment>
- </TableColumnHeader>
- <TableColumnHeader>
- <Label>Name</Label>
- <Alignment>left</Alignment>
- </TableColumnHeader>
- <TableColumnHeader>
- <Label>DisplayName</Label>
- <Alignment>left</Alignment>
- </TableColumnHeader>
- </TableHeaders>
- <TableRowEntries>
- <TableRowEntry>
- <TableColumnItems>
- <TableColumnItem>
- <ScriptBlock>
- $status = $_.Status
- switch ($_.Status) {
- 'Running'{
- "$([char](0x1B))[38;5;10m$status$([char](0x1B))[0m"
- }
- 'Stopped'{
- "$([char](0x1B))[38;5;9m$status$([char](0x1B))[0m"
- }
- default {
- "$([char](0x1B))[38;5;13m$status$([char](0x1B))[0m"
- }
- }
- </ScriptBlock>
- </TableColumnItem>
- <TableColumnItem>
- <ScriptBlock>
- $startType = $_.StartType
- switch ([string]$_.StartType) {
- 'Manual'{
- "$([char](0x1B))[38;5;12m$startType$([char](0x1B))[0m"
- }
- 'Automatic'{
- "$([char](0x1B))[38;5;10m$startType$([char](0x1B))[0m"
- }
- 'Disabled'{
- "$([char](0x1B))[38;5;9m$startType$([char](0x1B))[0m"
- }
- default {
- "$([char](0x1B))[38;5;13m$startType$([char](0x1B))[0m"
- }
- }
- </ScriptBlock>
- </TableColumnItem>
- <TableColumnItem>
- <PropertyName>Name</PropertyName>
- </TableColumnItem>
- <TableColumnItem>
- <PropertyName>DisplayName</PropertyName>
- </TableColumnItem>
- </TableColumnItems>
- </TableRowEntry>
- </TableRowEntries>
- </TableControl>
- </View>
- </ViewDefinitions>
- </Configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement