Public/Get-CAMRelationshipObject.ps1

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
Function Get-CAMRelationshipObject
{
<#
    .SYNOPSIS
        Function to retrieve the relationship object(s) of an Object
     
    .DESCRIPTION
        Function to retrieve the relationship object(s) of an Object
     
    .PARAMETER BySource
        Specifies the Object to process
         
  .EXAMPLE
    $HardwareAssetPCpro = Get-CamHardwareAsset -DisplayName "PCPro"
        Get-CAMRelationshipObject -BySource $HardwareAssetPCpro
         
        This will retrieve all the relationship objects to the Hardware Asset "PCPro"
     
    .EXAMPLE
      $SupportContract = Get-CAMSupportContract -DisplayName "Dell Servers 2016"
        Get-CAMRelationshipObject -BySource $SupportContract
         
        This will retrieve all the relationship objects to the Support Contract "Dell Servers 2016"
     
    .NOTES
        Francois-Xavier Cat
        www.lazywinadmin.com
        @lazywinadm
        github.com/lazywinadmin
#>

    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipeline)]
        [Alias('WorkItemObject')]
        $BySource
    )
    Get-SCSMRelationshipObject -BySource $WorkItemObject
}