If you paste a command into Teams and send it to poshbot it adds some whitespace "\r\n" to the command.
Expected Behavior
Paste "!Get-Something" into Teams and send to poshbot.
PoshBot will recognize that it begins with '!' and will interpret it as a bot command.
Current Behavior
Paste "!Get-Something" into Teams and send to poshbot.
PoshBot interprets the command as beginning with \r\n rather than '!' so it wouldn't be detected as a bot command.
Possible Solution
I think that we should use the parsed command to determine if it starts with an approved prefix or not.
$parsedCommand = [CommandParser]::Parse($Message)
This returns the actual beginning of the command and removes the \r\n.
Your Environment
Module version used: 11
Operating System and PowerShell version:
Windows 10, PowerShell 6.0.4
If you paste a command into Teams and send it to poshbot it adds some whitespace "\r\n" to the command.
Expected Behavior
Paste "!Get-Something" into Teams and send to poshbot. PoshBot will recognize that it begins with '!' and will interpret it as a bot command.
Current Behavior
Paste "!Get-Something" into Teams and send to poshbot. PoshBot interprets the command as beginning with \r\n rather than '!' so it wouldn't be detected as a bot command.
Possible Solution
I think that we should use the parsed command to determine if it starts with an approved prefix or not. $parsedCommand = [CommandParser]::Parse($Message) This returns the actual beginning of the command and removes the \r\n.
Your Environment