formats/vm-snapshot.ps1xml

<?xml version="1.0" encoding="utf-8"?>
<!-- SPDX-License-Identifier: Apache-2.0 -->
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd">
    <ViewDefinitions>
        <View>
            <Name>XoPowershell.VmSnapshot</Name>
            <ViewSelectedBy>
                <TypeName>XoPowershell.VmSnapshot</TypeName>
            </ViewSelectedBy>
            <TableControl>
                <TableRowEntries>
                    <TableRowEntry>
                        <TableColumnItems>
                            <TableColumnItem>
                                <PropertyName>VmSnapshotUuid</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Name</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>SnapshotTime</PropertyName>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    try { $_.CPUs } catch { "" }
                                </ScriptBlock>
                                <Alignment>Right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <ScriptBlock>
                                    if ($null -eq $_.Memory) { "" }
                                    elseif ($_.Memory.PSObject.Properties.Name -contains 'size') { $_.Memory.size }
                                    else { "" }
                                </ScriptBlock>
                                <Alignment>Right</Alignment>
                            </TableColumnItem>
                            <TableColumnItem>
                                <PropertyName>Description</PropertyName>
                            </TableColumnItem>
                        </TableColumnItems>
                    </TableRowEntry>
                </TableRowEntries>
                <TableHeaders>
                    <TableColumnHeader>
                        <Label>ID</Label>
                        <Width>36</Width>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Name</Label>
                        <Width>20</Width>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>SnapshotTime</Label>
                        <Width>26</Width>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>CPUs</Label>
                        <Width>5</Width>
                        <Alignment>Right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Memory</Label>
                        <Width>15</Width>
                        <Alignment>Right</Alignment>
                    </TableColumnHeader>
                    <TableColumnHeader>
                        <Label>Description</Label>
                        <Width>30</Width>
                    </TableColumnHeader>
                </TableHeaders>
            </TableControl>
        </View>
    </ViewDefinitions>
</Configuration>