SMLets.Types.ps1xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<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</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).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>