Public/MIA/Select-MIATaskStep.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
40
41
42
43
44
45
function Select-MIATaskStep
{
    [CmdletBinding()]
    param(
        [Parameter(Mandatory,
                    ValueFromPipeline)]
        [Object[]]$TaskObject
    )

    begin{}

    process
    {
        foreach ($task in $TaskObject)
        {
            foreach ($step in $task.steps)
            {
                foreach ($source in $step.Source)
                {
                   [PSCustomObject]@{
                       Step = 'Source'
                       HostID = $source.HostID
                       Type = $source.Type
                       Path = $source.Path
                       FileMask = $source.FileMask
                   }
                }

                foreach ($dest in $step.Destination)
                {
                    [PSCustomObject]@{
                        Step = 'Destination'
                        HostID = $dest.HostID
                        Type = $dest.Type
                        Path = $dest.Path
                        FileName = $dest.FileName
                    }
                }
            }
        }

    }

    end{}
}