
إطار عمل بوت مبني على باورشيل
| 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 بتنفيذ الدوال أو cmdlets من وحدات PowerShell. استخدم PoshBot للاتصال بالخوادم والإبلاغ عن الحالة، نشر الكود، تنفيذ runbooks، الاستعلام عن APIs، إلخ. إذا كان بإمكانك كتابته في PowerShell، يمكن لـ PoshBot تنفيذه.
يمكن العثور على التوثيق المفصل في ReadTheDocs.
انظر بناء PoshBot للحصول على توثيق حول كيفية بناء PoshBot من المصدر.
التغييرات المفصلة لكل إصدار موثقة في ملاحظات الإصدار.
للبدء الآن، احصل على رمز SLACK-API-TOKEN للروبوت الخاص بك:
# 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