Skip to content

MethosNL/TrellOps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

TrellOps

This Windows PowerShell module is for the management of Trello.

28th of May, 2016: Help and examples for this module uploaded.
21st of August, 2017: Added Get-TrelloSecret and Get-TrelloKey
Written by: Jeff Wouters

Example

This is an example on how you can use this Windows PowerShell module in order to manage your Trello environment.

###Get your secret

$Secret = Get-TrelloSecret

##Get your key

$Key = Get-TrelloKey

##Get your token

$AuthRead = New-TrelloToken -Key $Key -AppName "TrellOpsRead" -Expiration "never" -Scope 'read'
$AuthWrite = New-TrelloToken -Key $Key -AppName "TrellOpsWrite" -Expiration "never" -Scope 'read,write'

Get-TrelloBoard -Token $AuthRead -All

####Create a board

$TrelloBoard = New-TrelloBoard -Token $AuthWrite -Name "MethosIT - Demo" -Description "This is demo board of Methos IT"

####Create lists on the board

$TrelloBoardList_UnprioritisedBacklog = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Un-prioritised Backlog" -Position "bottom"
$TrelloBoardList_Backlog = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Backlog" -Position "bottom"
$TrelloBoardList_Sprint = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Sprint" -Position "bottom"
$TrelloBoardList_WIP = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "WIP (Work in Progress)" -Position "bottom"
$TrelloBoardList_Done = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Done" -Position "bottom"
$TrelloBoardList_Impediments = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Impediments" -Position "bottom"

####Create labels on the board

$TrelloBoardLabel_Daily = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Daily" -Color "red"
$TrelloBoardLabel_Weekly = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Weekly" -Color "blue"
$TrelloBoardLabel_Monthly = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Monthly" -Color "black"

####Create cards in the lists

$NewTrelloCard = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard" -Description "Just some description" -Label $TrelloBoardLabel_Daily.id -Position "bottom"
$NewTrelloCard2 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard2" -Description "Just some description" -Label $TrelloBoardLabel_Weekly.id -Position "bottom"
$NewTrelloCard3 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard3" -Description "Just some description" -Label $TrelloBoardLabel_Weekly.id -Position "bottom"
$NewTrelloCard4 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard4" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
$NewTrelloCard5 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard5" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
$NewTrelloCard6 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard6" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
$NewTrelloCard7 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard7" -Description "Just some description" -Position "bottom"

####Create a checklist in a card

$TrelloCardChecklist = Add-TrelloChecklist -Token $AuthWrite -Id $NewTrelloCard.id -Name "Checklist" -Position "top"

####Create items in the checklist


$TrelloCardChecklistItem1 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is my rifle,"
$TrelloCardChecklistItem2 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is my gun."
$TrelloCardChecklistItem3 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is for fighting,"
$TrelloCardChecklistItem4 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is for fun."

####Add an attachment to a card

$TrelloCardAttachment = Add-TrelloAttachment -Token $AuthWrite -Id $NewTrelloCard.id -Name "Some attachment" -Url "http://www.desktopbackgroundsi.net/wp-content/uploads/Picture_6.jpg"
$TrelloCardAttachment2 = Add-TrelloAttachment -Token $AuthWrite -Id $NewTrelloCard7.id -Name "Some attachment" -Url "http://www.freewebheaders.com/wordpress/wp-content/gallery/global/global-franchise-blue-header.jpg"

Clean up the demo board

#Remove what you've created

####Remove items from a checklist

Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem4.id
Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem3.id
Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem2.id
Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem1.id

####Remove checklist
Remove-TrelloChecklist -Token $AuthWrite -Id $TrelloCardChecklist.id

####Remove attachment from a card

Remove-TrelloAttachment -Token $AuthWrite -Id $TrelloCardAttachment.id -CardId $NewTrelloCard.id
Remove-TrelloAttachment -Token $AuthWrite -Id $TrelloCardAttachment2.id -CardId $NewTrelloCard7.id

####Remove cards

Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard7.id
Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard6.id
Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard5.id
Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard4.id
Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard3.id
Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard2.id
Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard.id

####Remove labels

Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Daily.id
Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Weekkly.id
Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Monthly.id

About

PowerShell module for Trello

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published