1) TimeStamp wasn't getting set when called directly. Seemed to reference an old variable MessageTS?
2) The help example showed forcing / overriding a ChannelID when sending pipelined input. The code didn't seem to allow that previously, and specifying a ChannelID to be needed when deleting from a private channel, as the pipelined channel name isn't sufficient. Here's the example from the help file which now works for me after these edits:
Get-SlackHistory -Count 1000 |
Where-Object Username -match "MalfunctioningBot" |
Remove-SlackMessage -ChannelID "C5H8XBUMV"
1) TimeStamp wasn't getting set when called directly. Seemed to reference an old variable MessageTS? 2) The help example showed forcing / overriding a ChannelID when sending pipelined input. The code didn't seem to allow that previously, and specifying a ChannelID to be needed when deleting from a private channel, as the pipelined channel name isn't sufficient. Here's the example from the help file which now works for me after these edits: Get-SlackHistory -Count 1000 | Where-Object Username -match "MalfunctioningBot" | Remove-SlackMessage -ChannelID "C5H8XBUMV"