我正在使用Users.admin.invite方法来使用Powershell模块“ PSSlack”发送api调用。
https://www.powershellgallery.com/packages/PSSlack/0.0.17/Content/Public%5CSend-SlackAPI.ps1
这是我写的:
$token = xoxp-XXXX
$email = "someone@domain.com"
Send-SlackApi -Token $token -Method users.admin.invite -Proxy $email -Verbose`
这是我得到的错误:
Send-SlackApi : Slack API call failed: This operation is not supported for a relative URI.
At line:6 char:1
+ Send-SlackApi -Token $token -Method users.admin.invite -Proxy $email ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Send-SlackApi
VERBOSE: Something went wrong. $Response is $null
答案 0 :(得分:1)
好,我发现这是正确的语法:
$token = xoxp-XXXX
$email = "someone@domain.com"
Send-SlackApi -Token $token -Method users.admin.invite?email=$email