| Azure Pipelines | GitHub Actions | ドキュメント | PS Gallery | ライセンス |
|---|---|---|---|---|
PoshBot は MIT ライセンスのオープンソースプロジェクトです。継続的な開発はスポンサーのサポートによって可能になっています。 スポンサーになりたい場合は、GitHub Sponsors または Patreon を通じてご支援いただけます。
詳細なガイドをお求めですか? ChatOps the Easy Way を Leanpub でチェックしてみてください!
PoshBot は PowerShell で書かれたチャットボットです。 PowerShell 5.0 で導入されたクラスを広範囲に使用しています。 PowerShell モジュールは PoshBot に読み込まれ、即座にボットコマンドとして利用可能になります。 PoshBot は現在 Slack への接続をサポートしており、素晴らしい ChatOps 体験を提供します。
基本的には何でもできます :) 本当です。 PoshBot は PowerShell モジュールの関数やコマンドレットを実行します。 サーバーに接続してステータスを報告したり、コードをデプロイしたり、Runbook を実行したり、API をクエリしたりするために PoshBot を使用します。 PowerShell で書けるものなら、PoshBot で実行できます。
詳細なドキュメントは ReadTheDocs でご覧いただけます。
ソースから PoshBot をビルドする方法については、Building PoshBot を参照してください。
各リリースの詳細な変更は リリースノート に記載されています。
すぐに始めるには、ボット用の SLACK-API-TOKEN を取得します:
https://my.slack.com/services/new/bot
# Install the module from PSGallery
Install-Module -Name PoshBot -Repository PSGallery
# Import the module
Import-Module -Name PoshBot
# Create a bot configuration
$botParams = @{
Name = 'name'
BotAdmins = @('<SLACK-CHAT-HANDLE>')
CommandPrefix = '!'
LogLevel = 'Info'
BackendConfiguration = @{
Name = 'SlackBackend'
Token = '<SLACK-API-TOKEN>'
}
AlternateCommandPrefixes = 'bender', 'hal'
}
$myBotConfig = New-PoshBotConfiguration @botParams
# Start a new instance of PoshBot interactively or in a job.
Start-PoshBot -Configuration $myBotConfig #-AsJob
基本的な使い方:
# Create a Slack backend
$backendConfig = @{Name = 'SlackBackend'; Token = '<SLACK-API-TOKEN>'}
$backend = New-PoshBotSlackBackend -Configuration $backendConfig
# Create a PoshBot configuration
$pbc = New-PoshBotConfiguration -BotAdmins @('<MY-SLACK-HANDLE>') -BackendConfiguration $backendConfig
# Save configuration
Save-PoshBotConfiguration -InputObject $pbc -Path .\PoshBotConfig.psd1
# Load configuration
$pbc = Get-PoshBotConfiguration -Path .\PoshBotConfig.psd1
# Create an instance of the bot
$bot = New-PoshBotInstance -Configuration $pbc -Backend $backend
# Start the bot
$bot.Start()
# Available commands
Get-Command -Module PoshBot
CommandType Name Version Source
----------- ---- ------- ------
Function Get-PoshBot 0.12.0 poshbot
Function Get-PoshBotConfiguration 0.12.0 poshbot
Function Get-PoshBotStatefulData 0.12.0 poshbot
Function New-PoshBotCardResponse 0.12.0 poshbot
Function New-PoshBotConfiguration 0.12.0 poshbot
Function New-PoshBotDiscordBackend 0.12.0 poshbot
Function New-PoshBotFileUpload 0.12.0 poshbot
Function New-PoshBotInstance 0.12.0 poshbot
Function New-PoshBotMiddlewareHook 0.12.0 poshbot
Function New-PoshBotScheduledTask 0.12.0 poshbot
Function New-PoshBotSlackBackend 0.12.0 poshbot
Function New-PoshBotTeamsBackend 0.12.0 poshbot
Function New-PoshBotTextResponse 0.12.0 poshbot
Function Remove-PoshBotStatefulData 0.12.0 poshbot
Function Save-PoshBotConfiguration 0.12.0 poshbot
Function Set-PoshBotStatefulData 0.12.0 poshbot
Function Start-PoshBot 0.12.0 poshbot
Function Stop-Poshbot 0.12.0 poshbot