Carbon.types.ps1xml

<?xml version="1.0" encoding="utf-8"?>
<!--
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
    
       http://www.apache.org/licenses/LICENSE-2.0
    
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<Types>
    <Type>
        <Name>Carbon.Firewall.Rule</Name>
        <Members>
            <AliasProperty>
                <Name>LocalIP</Name>
                <ReferencedMemberName>
                    LocalIPAddress
                </ReferencedMemberName>
            </AliasProperty>
            <AliasProperty>
                <Name>RemoteIP</Name>
                <ReferencedMemberName>
                    RemoteIPAddress
                </ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
    <Type>
        <Name>Carbon.TaskScheduler.TaskInfo</Name>
        <Members>
            <AliasProperty>
                <Name>State</Name>
                <ReferencedMemberName>Status</ReferencedMemberName>
            </AliasProperty>
            <ScriptProperty>
                <Name>FullName</Name>
                <GetScriptBlock>
                    return Join-Path -Path $this.TaskPath -ChildPath $this.TaskName
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>System.Diagnostics.Process</Name>
        <Members>
            <ScriptProperty>
                <Name>ParentProcessID</Name>
                <GetScriptBlock>
                    $filter = "ProcessID='{0}'" -f $this.Id
                    $process = Get-WmiObject Win32_Process -Filter $filter
                    $process.ParentProcessID
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>System.DirectoryServices.AccountManagement.Principal</Name>
        <Members>
            <ScriptProperty>
                <Name>ConnectedServer</Name>
                <GetScriptBlock>
                    $this.Context.ConnectedServer
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>System.Security.Cryptography.X509Certificates.X509Certificate2</Name>
        <Members>
            <ScriptProperty>
                <Name>IssuedTo</Name>
                <GetScriptBlock>
                    $this.GetNameInfo( 'SimpleName', $false )
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>IssuedBy</Name>
                <GetScriptBlock>
                    $this.GetNameInfo( 'SimpleName', $true )
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>System.Security.Cryptography.X509Certificates.X509Store</Name>
        <Members>
            <ScriptProperty>
                <Name>DisplayName</Name>
                <GetScriptBlock>
                    switch( $this.Name )
                    {
                        'AddressBook' { return 'Other People' }
                        'AuthRoot' { return 'Third-Party Root Certification Authorities' }
                        'CA' { return 'Intermediate Certification Authorities' }
                        'CertificateAuthority' { return 'Intermediate Certification Authorities' }
                        'Disallowed' { return 'Untrusted Certificates' }
                        'My' { return 'Personal' }
                        'Root' { return 'Trusted Root Certification Authorities' }
                        'TrustedPeople' { return 'Trusted People' }
                        'TrustedPublisher' { return 'Trusted Publishers' }
                        default { return '' }
                    }
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>StoreName</Name>
                <GetScriptBlock>
                    if( $this.Name -eq 'CA' )
                    {
                        return [Security.Cryptography.X509Certificates.StoreName]::CertificateAuthority
                    }
 
                    foreach( $value in ([Enum]::GetValues([Security.Cryptography.X509Certificates.StoreName])) )
                    {
                        if( $this.Name -eq $value.ToString() )
                        {
                            return $value
                        }
                    }
 
                    return ''
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
</Types>