SMLets.Types.ps1xml

<Types>
 
    <Type>
        <Name>EnterpriseManagementObjectProjection#System.ServiceOffering.ProjectionType</Name>
        <Members>
            <AliasProperty>
                <Name>ManagementPackName</Name>
                <ReferencedMemberName>Domain</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
 
    <Type>
        <Name>EnterpriseManagementObjectProjection#System.RequestOffering.ProjectionType</Name>
        <Members>
            <AliasProperty>
                <Name>ManagementPackName</Name>
                <ReferencedMemberName>Domain</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
 
    <Type>
        <Name>EnterpriseManagementObjectProjection</Name>
        <Members>
            <ScriptProperty>
                <Name>LastModified</Name>
                <GetScriptBlock>
                    $this.Object.LastModified.ToLocalTime()
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>EnterpriseManagementObjectProjection#System.WorkItem.Incident.View.ProjectionType</Name>
        <Members>
            <AliasProperty>
                <Name>AffectedUser</Name>
                <ReferencedMemberName>RequestedWorkItem</ReferencedMemberName>
            </AliasProperty>
            <AliasProperty>
                <Name>AssignedTo</Name>
                <ReferencedMemberName>AssignedWorkItem</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackRelationshipEndpoint</Name>
        <Members>
            <ScriptProperty>
                <Name>Class</Name>
                <GetScriptBlock>Get-SCSMClass -id $this.type.id -SCSMSession $this.ManagementGroup</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPack</Name>
        <Members>
            <ScriptMethod>
                <Name>GetXML</Name>
                <Script>
try
{
    $__ms = new-object io.memorystream
    $__writer = [xml.xmlwriter]::Create($__ms)
    $__mpWriter = new-object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter $__writer
    $__mpWriter.WriteManagementPack($this)|out-null
    $__buffer = new-object byte[] $__ms.Length
    $__ms.Seek(0,0)|out-null
    $__ms.Read($__buffer, 0, $__ms.Length)|out-null
    (new-object System.Text.UTF8Encoding).GetString($__buffer).SubString(1)
}
catch
{
    Write-Host -for red "Can't get XML - export instead"
}
finally
{
    $__writer.Close()
    $__ms.Close()
    $__ms.Dispose()
}
                </Script>
            </ScriptMethod>
        </Members>
    </Type>
    <Type>
      <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackTypeProjection</Name>
      <TypeConverter>
        <TypeName>SMLets.ProjectionConverter</TypeName>
      </TypeConverter>
    </Type>
    <Type>
      <Name>Microsoft.EnterpriseManagement.Common.EnterpriseManagementObjectProjection</Name>
      <TypeConverter>
        <TypeName>SMLets.ProjectionConverter</TypeName>
      </TypeConverter>
    </Type>
    <Type>
        <Name>EnterpriseManagementObjectProjection#Microsoft.Windows.Computer.ProjectionType</Name>
        <Members>
            <AliasProperty>
                <Name>Site</Name>
                <ReferencedMemberName>ActiveDirectorySite</ReferencedMemberName>
            </AliasProperty>
            <ScriptProperty>
                <Name>Manufacturer</Name>
                <GetScriptBlock>@($this.DeployedComputer)[0].Manufacturer</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Model</Name>
                <GetScriptBlock>@($this.DeployedComputer)[0].Model</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>OS</Name>
                <GetScriptBlock>$this.OperatingSystem.OSVersionDisplayName</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackProperty</Name>
        <Members>
            <ScriptProperty>
               <Name>Type</Name>
               <GetScriptBlock>
                    if ( $this.SystemType.FullName -eq "System.Enum" )
                    {
                        (get-scsmenumeration -id $this.enumtype.id -SCSMSession $this.ManagementGroup).Name
                    }
                    else
                    {
                        $this.Get_Type()
                    }
               </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Security.UserRole</Name>
        <Members>
            <ScriptProperty>
                <Name>Objects</Name>
                <GetScriptBlock>$this.Scope.Objects|%{get-scmanagementpackelement -id $_}</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Classes</Name>
                <GetScriptBlock>$this.Scope.Classes|%{get-scsmclass -id $_}</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Views</Name>
                <GetScriptBlock>$this.Scope.Views|%{Get-SCManagementPackElement $_.first.guid}</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>NonCredentialTasks</Name>
                <GetScriptBlock>$this.Scope.NonCredentialTasks</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>CredentialTasks</Name>
                <GetScriptBlock>$this.Scope.CredentialTasks</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Templates</Name>
                <GetScriptBlock>$this.Scope.Templates|%{get-scmanagementpackelement $_ }</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Subscriptions.SubscriptionJobStatus</Name>
        <Members>
            <ScriptProperty>
                <Name>OutputXml</Name>
                <GetScriptBlock>([xml]($this.output)).DataItem</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackEnumeration</Name>
        <Members>
            <ScriptMethod>
                <Name>ToString</Name>
                <Script>if ( $this.DisplayName ) { $this.DisplayName } else { $this.Name }</Script>
            </ScriptMethod>
            <ScriptMethod>
                <Name>op_Explicit</Name>
                <Script>$this.DisplayName</Script>
            </ScriptMethod>
            <ScriptMethod>
                <Name>op_Implicit</Name>
                <Script>$this.DisplayName</Script>
            </ScriptMethod>
            <ScriptMethod>
                <Name>Equals</Name>
                <Script>Write-Host -for red $args[0]; if ( $this.DisplayName -eq $args[0] ) { $true } else { $false }</Script>
            </ScriptMethod>
        </Members>
    </Type>
    <Type>
        <Name>EnterpriseManagementObject#DeletedObject</Name>
        <Members>
            <ScriptProperty>
                <Name>Class</Name>
                <GetScriptBlock>$this.GetLeastDerivedNonAbstractClass().DisplayName</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackRule</Name>
        <Members>
            <CodeMethod>
                <Name>GetJobStatus</Name>
                <CodeReference>
                    <TypeName>SMLets.WorkflowHelper</TypeName>
                    <MethodName>GetJobStatus</MethodName>
                </CodeReference>
            </CodeMethod>
        </Members>
    </Type>
    <Type>
        <Name>EnterpriseManagementObject#System.WorkItem.TroubleTicket.AnalystCommentLog</Name>
        <Members>
            <AliasProperty>
                <Name>UserComment</Name>
                <ReferencedMemberName>Comment</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
    <Type>
        <Name>EnterpriseManagementObject#System.WorkItem.TroubleTicket.ActionLog</Name>
        <Members>
            <AliasProperty>
                <Name>UserComment</Name>
                <ReferencedMemberName>Description</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
    <Type>
        <Name>EnterpriseManagementObjectProjection#System.WorkItem.Incident.ProjectionType</Name>
        <Members>
            <ScriptProperty>
                <Name>LastModified</Name>
                <GetScriptBlock>
                    $this.Object.LastModified.ToLocalTime()
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>EnterpriseManagementObjectProjection#System.WorkItem.Incident.ProjectionType</Name>
        <Members>
            <AliasProperty>
                <Name>AssignedTo</Name>
                <ReferencedMemberName>AssignedWorkItem</ReferencedMemberName>
            </AliasProperty>
            <AliasProperty>
                <Name>AffectedUser</Name>
                <ReferencedMemberName>RequestedWorkItem</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackElement</Name>
        <Members>
            <ScriptMethod>
                <Name>GetXML</Name>
                <Script>$this.CreateNavigator().OuterXml</Script>
            </ScriptMethod>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackObjectTemplate</Name>
        <Members>
            <ScriptProperty>
                <Name>ManagementPack</Name>
                <GetScriptBlock>$this.GetManagementPack().DisplayName</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackClass</Name>
        <Members>
            <ScriptProperty>
                <Name>ManagementPack</Name>
                <GetScriptBlock>$this.GetManagementPack().Name</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Properties</Name>
                <GetScriptBlock>$this.GetProperties()</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackTypeProjectionComponent</Name>
        <Members>
            <ScriptProperty>
                <Name>ParentName</Name>
                <GetScriptBlock>
                    $this.Parent.Name
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Seed</Name>
                <GetScriptBlock>
                    $SeedRole = $this.path -match "SeedRole='(\w+)'"
                    if ( $SeedRole )
                    {
                        $matches[1]
                    }
                    else
                    {
                        "Source"
                    }
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>Relationship</Name>
                <GetScriptBlock>
                    $isRelationship = $this.path -match "Relationship='\w+!([^'']*)'"
                    if ( $isRelationship )
                    {
                        Get-SCSMRelationshipclass $Matches[1]
                    }
                    else
                    {
                        [string]::empty
                    }
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
      <Type>
        <Name>Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject</Name>
        <Members>
            <ScriptProperty>
                <Name>ClassName</Name>
                <GetScriptBlock>
                    $this.GetLeastDerivedNonAbstractClass().Name
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>LastModified</Name>
                <GetScriptBlock>
                    $this.get_LastModified().ToLocalTime()
                </GetScriptBlock>
            </ScriptProperty>
            <ScriptMethod>
                <Name>AdaptEMO</Name>
                <Script>[SMLets.ServiceManagerObjectHelper]::AdaptManagementObject($this)</Script>
            </ScriptMethod>
            <ScriptProperty>
                <Name>TypeName</Name>
                <GetScriptBlock>
                    $this.psobject.typenames[0] -replace ".*#"
                </GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
      <Type>
        <Name>EnterpriseManagementObject#System.Domain.User</Name>
        <Members>
            <MemberSet>
                <Name>PSStandardMembers</Name>
                <Members>
                    <PropertySet>
                        <Name>DefaultDisplayPropertySet</Name>
                        <ReferencedProperties>
                            <Name>DisplayName</Name>
                            <Name>distinguishedName</Name>
                        </ReferencedProperties>
                    </PropertySet>
                </Members>
            </MemberSet>
        </Members>
    </Type>
    <Type>
        <Name>Microsoft.EnterpriseManagement.Configuration.ManagementPackDimensionType</Name>
        <Members>
            <ScriptProperty>
                <Name>TargetObject</Name>
                <GetScriptBlock>$this.ManagementGroup.EntityTypes.GetClass($this.Target.id.guid)</GetScriptBlock>
            </ScriptProperty>
            <ScriptProperty>
                <Name>XML</Name>
                <GetScriptBlock>$this.CreateNavigator().OuterXML</GetScriptBlock>
            </ScriptProperty>
        </Members>
    </Type>
     <Type>
         <Name>Microsoft.EnterpriseManagement.Subscriptions.WorkflowSubscription</Name>
         <Members>
            <AliasProperty>
                <Name>MaxRunTime</Name>
                <ReferencedMemberName>MaximumRunningTimeSeconds</ReferencedMemberName>
            </AliasProperty>
        </Members>
    </Type>
  
</Types>