xml/WinEventLogCustomization.Types.ps1xml

<?xml version="1.0" encoding="utf-8"?>
<Types>
    <!-- WELC.EventLogChannel -->
    <Type>
        <Name>WELC.EventLogChannel</Name>
        <Members>
            <AliasProperty>
                <Name>ComputerName</Name>
                <ReferencedMemberName>PSComputerName</ReferencedMemberName>
            </AliasProperty>
 
            <AliasProperty>
                <Name>Name</Name>
                <ReferencedMemberName>ChannelFullName</ReferencedMemberName>
            </AliasProperty>
 
            <ScriptProperty>
                <Name>Enabled</Name>
                <GetScriptBlock>
                    $this.WinEventLog.IsEnabled
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LogMode</Name>
                <GetScriptBlock>
                    $this.WinEventLog.LogMode
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LogType</Name>
                <GetScriptBlock>
                    $this.WinEventLog.LogType
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LogFullName</Name>
                <GetScriptBlock>
                    if($this.WinEventLog.LogFilePath -like '%SystemRoot%*') {
                        $this.WinEventLog.LogFilePath.Replace('%SystemRoot%', $env:SystemRoot)
                    } else {
                        if($this.WinEventLog.LogFilePath -like '%windir%*') {
                            $this.WinEventLog.LogFilePath.Replace('%windir%', $env:SystemRoot)
                        } else {
                            $this.WinEventLog.LogFilePath
                        }
                    }
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LogFile</Name>
                <GetScriptBlock>
                    Split-Path $this.LogFullName -Leaf
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LogFolder</Name>
                <GetScriptBlock>
                    Split-Path $this.LogFullName
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>MaxEventLogSize</Name>
                <GetScriptBlock>
                    $this.WinEventLog.MaximumSizeInBytes
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>FileSize</Name>
                <GetScriptBlock>
                    $this.WinEventLog.FileSize
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>RecordCount</Name>
                <GetScriptBlock>
                    $this.WinEventLog.RecordCount
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>IsFull</Name>
                <GetScriptBlock>
                    $this.WinEventLog.IsLogFull
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LastWriteTime</Name>
                <GetScriptBlock>
                    $this.WinEventLog.LastWriteTime
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>LastAccessTime</Name>
                <GetScriptBlock>
                    $this.WinEventLog.LastAccessTime
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>ChannelFullName</Name>
                <GetScriptBlock>
                    $this.WinEventLog.LogName
                </GetScriptBlock>
            </ScriptProperty>
 
 
            <ScriptProperty>
                <Name>ProviderName</Name>
                <GetScriptBlock>
                    $this.Provider.Name
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>ProviderId</Name>
                <GetScriptBlock>
                    $this.Provider.id
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>MessageFilePath</Name>
                <GetScriptBlock>
                    if($this.Provider.MessageFilePath -like '%SystemRoot%*') {
                        $this.Provider.MessageFilePath.Replace('%SystemRoot%', $env:SystemRoot)
                    } else {
                        if($this.Provider.MessageFilePath -like '%windir%*') {
                            $this.Provider.MessageFilePath.Replace('%windir%', $env:SystemRoot)
                        } else {
                            $this.Provider.MessageFilePath
                        }
                    }
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>ResourceFilePath</Name>
                <GetScriptBlock>
                    if($this.Provider.ResourceFilePath -like '%SystemRoot%*') {
                        $this.Provider.ResourceFilePath.Replace('%SystemRoot%', $env:SystemRoot)
                    } else {
                        if($this.Provider.ResourceFilePath -like '%windir%*') {
                            $this.Provider.ResourceFilePath.Replace('%windir%', $env:SystemRoot)
                        } else {
                            $this.Provider.ResourceFilePath
                        }
                    }
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>ParameterFilePath</Name>
                <GetScriptBlock>
                    if($this.Provider.ParameterFilePath -like '%SystemRoot%*') {
                        $this.Provider.ParameterFilePath.Replace('%SystemRoot%', $env:SystemRoot)
                    } else {
                        if($this.Provider.ParameterFilePath -like '%windir%*') {
                            $this.Provider.ParameterFilePath.Replace('%windir%', $env:SystemRoot)
                        } else {
                            $this.Provider.ParameterFilePath
                        }
                    }
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>ACL</Name>
                <GetScriptBlock>
                    ConvertFrom-SddlString -Sddl $this.WinEventLog.SecurityDescriptor
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>Owner</Name>
                <GetScriptBlock>
                    $this.ACL.Owner
                </GetScriptBlock>
            </ScriptProperty>
 
            <ScriptProperty>
                <Name>Access</Name>
                <GetScriptBlock>
                    $this.ACL.DiscretionaryAcl
                </GetScriptBlock>
            </ScriptProperty>
 
 
            <CodeProperty IsHidden="true">
                <Name>SerializationData</Name>
                <GetCodeReference>
                    <TypeName>PSFramework.Serialization.SerializationTypeConverter</TypeName>
                    <MethodName>GetSerializationData</MethodName>
                </GetCodeReference>
            </CodeProperty>
        </Members>
        <TypeConverter>
            <TypeName>PSFramework.Serialization.SerializationTypeConverter</TypeName>
        </TypeConverter>
    </Type>
<!--
    <Type>
        <Name>Deserialized.WELC.EventLogChannel</Name>
        <Members>
            <MemberSet>
                <Name>PSStandardMembers</Name>
                <Members>
                    <NoteProperty>
                        <Name>
                            TargetTypeForDeserialization
                        </Name>
                        <Value>
                            WELC.EventLogChannel
                        </Value>
                    </NoteProperty>
                </Members>
            </MemberSet>
        </Members>
    </Type>
-->
</Types>