Private/Parse-SlackUser.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
# Parse users
Function Parse-SlackUser {
    [cmdletbinding()]
    param( $InputObject )

    foreach($User in $InputObject)
    {
        [pscustomobject]@{
            PSTypeName = 'PSSlack.User'
            ID = $User.id
            Name = $User.name
            DisplayName = $User.Profile.Display_Name
            RealName = $User.Profile.Real_Name
            FirstName = $User.Profile.First_Name
            Last_Name = $User.Profile.Last_Name
            Email = $User.Profile.email
            Phone = $User.Profile.Phone
            Skype = $User.Profile.Skype
            IsBot = $User.Is_Bot
            IsAdmin = $User.Is_Admin
            IsOwner = $User.Is_Owner
            IsPrimaryOwner = $User.Is_Primary_Owner
            IsRestricted = $User.Is_Restricted
            IsUltraRestricted = $User.Is_Ultra_Restricted
            StatusText = $User.Profile.Status_Text
            StatusEmoji = $User.Profile.Status_Emoji
            TimeZoneLabel = $User.tz_label
            TimeZone = $User.tz
            Presence = $User.Presence
            Updated = ConvertFrom-UnixTime $User.updated
            Deleted = $User.Deleted
            Raw = $User
        }
    }
}