├── 1.0.1.25 ├── Tests │ ├── PSScriptAnalyzer.ps1 │ ├── psgallery.tests.ps1 │ ├── modulemanifest.tests.ps1 │ └── appveyor.pester.ps1 ├── TrellOps.psd1 ├── PSGetModuleInfo.xml ├── TrellOps.psm1 ├── Functions │ ├── Get-Key │ │ └── Get-Key.ps1 │ ├── Get-Secret │ │ └── Get-Secret.ps1 │ ├── Remove-Card │ │ └── Remove-Card.ps1 │ ├── Remove-Label │ │ └── Remove-Label.ps1 │ ├── Remove-Checklist │ │ └── Remove-Checklist.ps1 │ ├── Remove-ChecklistItem │ │ └── Remove-ChecklistItem.ps1 │ ├── Remove-Attachment │ │ └── Remove-Attachment.ps1 │ ├── Add-Attachment │ │ └── Add-Attachment.ps1 │ ├── New-List │ │ └── New-List.ps1 │ ├── Add-Checklist │ │ └── Add-Checklist.ps1 │ ├── New-Label │ │ └── New-Label.ps1 │ ├── Get-Member │ │ └── Get-Member.ps1 │ ├── Get-List │ │ └── Get-List.ps1 │ ├── Get-Checklist │ │ └── Get-Checklist.ps1 │ ├── Get-Attachment │ │ └── Get-Attachment.ps1 │ ├── Get-ChecklistItem │ │ └── Get-ChecklistItem.ps1 │ ├── Add-ChecklistItem │ │ └── Add-ChecklistItem.ps1 │ ├── New-Card │ │ └── New-Card.ps1 │ ├── Get-Card │ │ └── Get-Card.ps1 │ ├── Get-Label │ │ └── Get-Label.ps1 │ ├── Get-Board │ │ └── Get-Board.ps1 │ ├── New-Board │ │ └── New-Board.ps1 │ └── New-Token │ │ └── New-Token.ps1 └── README.md └── README.md /1.0.1.25/Tests/PSScriptAnalyzer.ps1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /1.0.1.25/TrellOps.psd1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MethosNL/TrellOps/HEAD/1.0.1.25/TrellOps.psd1 -------------------------------------------------------------------------------- /1.0.1.25/PSGetModuleInfo.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MethosNL/TrellOps/HEAD/1.0.1.25/PSGetModuleInfo.xml -------------------------------------------------------------------------------- /1.0.1.25/Tests/psgallery.tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Validation of PSGallery" { 2 | It "The PowerShell Gallery should be responsive" { 3 | $request = [System.Net.WebRequest]::Create("https://www.powershellgallery.com") 4 | $response = $Request.GetResponse() 5 | $response.StatusCode | Should be OK 6 | } 7 | } -------------------------------------------------------------------------------- /1.0.1.25/TrellOps.psm1: -------------------------------------------------------------------------------- 1 | $HelpersPath = "$PSScriptRoot\Helpers" 2 | Get-ChildItem $HelpersPath -Directory -Exclude "Tests" | ForEach-Object { 3 | . (join-path $HelpersPath (Join-Path $_.BaseName "$($_.BaseName).ps1")) 4 | } 5 | 6 | $FunctionsPath = "$PSScriptRoot\Functions" 7 | Get-ChildItem $FunctionsPath -Directory -Exclude "Tests" | ForEach-Object { 8 | . (join-path $FunctionsPath (Join-Path $_.BaseName "$($_.BaseName).ps1")) 9 | } -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Key/Get-Key.ps1: -------------------------------------------------------------------------------- 1 | function Get-Key { 2 | $IE = New-Object -ComObject InternetExplorer.Application 3 | $IE.Navigate('https://trello.com/app-key') 4 | while ($IE.LocationURL -ne 'https://trello.com/app-key') { 5 | Start-Sleep -Seconds 2 6 | } 7 | $InnerHTML = $IE.Document.body.innerHTML 8 | New-Object -TypeName PSObject -Property @{ 9 | 'Key' = . { 10 | [regex]::Match($InnerHTML,'[0-9a-z]{32}').value 11 | } 12 | } 13 | $IE.Quit() 14 | } -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Secret/Get-Secret.ps1: -------------------------------------------------------------------------------- 1 | function Get-Secret { 2 | $IE = New-Object -ComObject InternetExplorer.Application 3 | $IE.Navigate('https://trello.com/app-key') 4 | while ($IE.LocationURL -ne 'https://trello.com/app-key') { 5 | Start-Sleep -Seconds 2 6 | } 7 | $InnerHTML = $IE.Document.body.innerHTML 8 | New-Object -TypeName PSObject -Property @{ 9 | 'Secret' = . { 10 | [regex]::Match($InnerHTML,'[0-9a-z]{64}').value 11 | } 12 | } 13 | $IE.Quit() 14 | } -------------------------------------------------------------------------------- /1.0.1.25/Tests/modulemanifest.tests.ps1: -------------------------------------------------------------------------------- 1 | $ProjectRoot = $ENV:APPVEYOR_BUILD_FOLDER 2 | [string[]]$ManifestPath = (Get-ChildItem -Path $ProjectRoot -Include *.psd1 -Recurse).FullName 3 | foreach ($Manifest in $ManifestPath) { 4 | Describe "Validation of Module Manifest $(Split-Path $Manifest -Leaf)" { 5 | It 'Only exports functions listed in the module manifest' { 6 | 1 | Should Be 1 7 | } 8 | } 9 | Describe "Module manifest" { 10 | It 'Has an author in it' { 11 | 1 | Should Be 1 12 | } 13 | It 'Has a copyright in it' { 14 | 1 | Should Be 1 15 | } 16 | It 'Has a company in it' { 17 | 1 | Should Be 1 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /1.0.1.25/Functions/Remove-Card/Remove-Card.ps1: -------------------------------------------------------------------------------- 1 | function Remove-Card { 2 | <# 3 | .Synopsis 4 | Removes a Trello Card. 5 | .Description 6 | Removes a Trello Card. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id 20 | ) 21 | begin 22 | { 23 | } 24 | process 25 | { 26 | try 27 | { 28 | Invoke-RestMethod -Method "Delete" -Uri "https://api.trello.com/1/cards/$($Id)/?token=$($Token.Token)&key=$($Token.AccessKey)" 29 | } 30 | catch 31 | { 32 | } 33 | } 34 | end 35 | { 36 | } 37 | } 38 | 39 | Export-ModuleMember Remove-Card -------------------------------------------------------------------------------- /1.0.1.25/Functions/Remove-Label/Remove-Label.ps1: -------------------------------------------------------------------------------- 1 | function Remove-Label { 2 | <# 3 | .Synopsis 4 | Removes a Trello Label. 5 | .Description 6 | Removes a Trello Label. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id 20 | ) 21 | begin 22 | { 23 | } 24 | process 25 | { 26 | try 27 | { 28 | Invoke-RestMethod -Method "Delete" -Uri "https://api.trello.com/1/labels/$($Id)/?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 29 | } 30 | catch 31 | { 32 | } 33 | } 34 | end 35 | { 36 | } 37 | } 38 | 39 | Export-ModuleMember Remove-Label -------------------------------------------------------------------------------- /1.0.1.25/Functions/Remove-Checklist/Remove-Checklist.ps1: -------------------------------------------------------------------------------- 1 | function Remove-Checklist { 2 | <# 3 | .Synopsis 4 | Removes a Trello Checklist. 5 | .Description 6 | Removes a Trello Checklist. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id 20 | ) 21 | begin 22 | { 23 | } 24 | process 25 | { 26 | try 27 | { 28 | Invoke-RestMethod -Method "Delete" -Uri "https://api.trello.com/1/checklists/$($Id)/?token=$($Token.Token)&key=$($Token.AccessKey)" 29 | } 30 | catch 31 | { 32 | } 33 | } 34 | end 35 | { 36 | } 37 | } 38 | 39 | Export-ModuleMember Remove-Checklist -------------------------------------------------------------------------------- /1.0.1.25/Functions/Remove-ChecklistItem/Remove-ChecklistItem.ps1: -------------------------------------------------------------------------------- 1 | function Remove-ChecklistItem { 2 | <# 3 | .Synopsis 4 | Removes a Trello Checklist Item. 5 | .Description 6 | Removes a Trello Checklist Item. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=1 23 | )] 24 | $ItemId 25 | ) 26 | begin 27 | { 28 | } 29 | process 30 | { 31 | try 32 | { 33 | Invoke-RestMethod -Method "Delete" -Uri "https://api.trello.com/1/checklists/$Id/checkItems/$ItemId/?token=$($Token.Token)&key=$($Token.AccessKey)" 34 | } 35 | catch 36 | { 37 | } 38 | } 39 | end 40 | { 41 | } 42 | } 43 | 44 | Export-ModuleMember Remove-ChecklistItem -------------------------------------------------------------------------------- /1.0.1.25/Functions/Remove-Attachment/Remove-Attachment.ps1: -------------------------------------------------------------------------------- 1 | function Remove-Attachment { 2 | <# 3 | .Synopsis 4 | Removes a Trello Checklist Attachment. 5 | .Description 6 | Removes a Trello Checklist Attachment. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | [string]$CardId 25 | ) 26 | begin 27 | { 28 | } 29 | process 30 | { 31 | try 32 | { 33 | Invoke-RestMethod -Method "Delete" -Uri "https://api.trello.com/1/cards/$CardId/attachments/$Id/?token=$($Token.Token)&key=$($Token.AccessKey)" 34 | } 35 | catch 36 | { 37 | } 38 | } 39 | end 40 | { 41 | } 42 | } 43 | 44 | Export-ModuleMember Remove-Attachment -------------------------------------------------------------------------------- /1.0.1.25/Functions/Add-Attachment/Add-Attachment.ps1: -------------------------------------------------------------------------------- 1 | function Add-Attachment { 2 | <# 3 | .Synopsis 4 | Adds an attachment a Trello Card. 5 | .Description 6 | Adds an attachment a Trello Card. 7 | #> 8 | [cmdletbinding()] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | [string]$Name, 25 | [parameter( 26 | Mandatory=$true, 27 | Position=3 28 | )] 29 | [string]$URL 30 | ) 31 | begin 32 | { 33 | } 34 | process 35 | { 36 | try 37 | { 38 | $Hash = @{ 39 | "name" = $Name 40 | "url" = $url 41 | } 42 | Invoke-RestMethod -Method "Post" -Uri "https://api.trello.com/1/cards/$($Id)/attachments?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 43 | } 44 | catch 45 | { 46 | Write-Error $_ 47 | } 48 | } 49 | end 50 | { 51 | } 52 | } 53 | 54 | Export-ModuleMember Add-Attachment -------------------------------------------------------------------------------- /1.0.1.25/Functions/New-List/New-List.ps1: -------------------------------------------------------------------------------- 1 | function New-List { 2 | <# 3 | .Synopsis 4 | Adds a list to a Trello Board. 5 | .Description 6 | Adds a list to a Trello Board. 7 | #> 8 | [cmdletbinding()] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | [string]$Name, 25 | [parameter( 26 | Mandatory=$false, 27 | Position=3 28 | )] 29 | [ValidateSet("top","bottom")] 30 | [string]$Position = "top" 31 | ) 32 | begin 33 | { 34 | } 35 | process 36 | { 37 | try 38 | { 39 | $Hash = @{ 40 | "name" = $Name 41 | "idBoard" = $Id 42 | "pos" = $Position 43 | } 44 | Invoke-RestMethod -Method "Post" -Uri "https://api.trello.com/1/lists?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 45 | } 46 | catch 47 | { 48 | Write-Error $_ 49 | } 50 | } 51 | end 52 | { 53 | } 54 | } 55 | 56 | Export-ModuleMember New-List -------------------------------------------------------------------------------- /1.0.1.25/Functions/Add-Checklist/Add-Checklist.ps1: -------------------------------------------------------------------------------- 1 | function Add-Checklist { 2 | <# 3 | .Synopsis 4 | Adds a new Checklists to a Trello card. 5 | .Description 6 | Adds a new Checklists to a Trello card. 7 | #> 8 | [cmdletbinding()] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | [string]$Name, 25 | [parameter( 26 | Mandatory=$false, 27 | Position=3 28 | )] 29 | [ValidateSet("top","bottom")] 30 | [string]$Position = "top" 31 | ) 32 | begin 33 | { 34 | } 35 | process 36 | { 37 | try 38 | { 39 | $Hash = @{ 40 | "id" = $Id 41 | "name" = $Name 42 | "pos" = $Position 43 | } 44 | Invoke-RestMethod "Post" -Uri "https://api.trello.com/1/cards/$($Id)/checklists?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 45 | } 46 | catch 47 | { 48 | Write-Error $_ 49 | } 50 | } 51 | end 52 | { 53 | } 54 | } 55 | 56 | Export-ModuleMember Add-Checklist -------------------------------------------------------------------------------- /1.0.1.25/Functions/New-Label/New-Label.ps1: -------------------------------------------------------------------------------- 1 | function New-Label { 2 | <# 3 | .Synopsis 4 | Creates a new Trello Label. 5 | .Description 6 | Creates a new Trello Label. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2, 23 | ParameterSetName="Name" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$true, 28 | Position=3 29 | )] 30 | [ValidateSet("yellow","sky","red","purple","pink","orange","lime","green","blue","black")] 31 | [string]$Color 32 | ) 33 | begin 34 | { 35 | } 36 | process 37 | { 38 | try 39 | { 40 | $Hash = @{ 41 | "name" = $Name 42 | "color" = $color 43 | "idBoard" = $Id 44 | } 45 | Invoke-RestMethod -Method "Post" -Uri "https://api.trello.com/1/labels/?token=$($AuthWrite.Token)&key=$($AuthWrite.AccessKey)" -Body $Hash 46 | } 47 | catch 48 | { 49 | } 50 | } 51 | end 52 | { 53 | } 54 | } 55 | 56 | Export-ModuleMember New-Label -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Member/Get-Member.ps1: -------------------------------------------------------------------------------- 1 | function Get-Member { 2 | <# 3 | .Synopsis 4 | Gets member of a Trello board. 5 | .Description 6 | Gets member of a Trello board. 7 | #> 8 | [CmdletBinding(DefaultParameterSetName="UserName")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1, 18 | ParameterSetName="Id" 19 | )] 20 | [string]$Id, 21 | [parameter( 22 | Mandatory=$true, 23 | Position=2, 24 | ParameterSetName="UserName" 25 | )] 26 | [string]$UserName 27 | ) 28 | begin 29 | { 30 | } 31 | process 32 | { 33 | try 34 | { 35 | switch ($PsCmdlet.ParameterSetName) 36 | { 37 | "Id" { 38 | $Option = $Id 39 | break 40 | } 41 | "UserName" { 42 | $Option = $UserName 43 | break 44 | } 45 | } 46 | Invoke-RestMethod -Method "Get" -Uri "https://api.trello.com/1/members/$Option/?token=$($Token.Token)&key=$($Token.AccessKey)" 47 | } 48 | catch 49 | { 50 | Write-Error $_ 51 | } 52 | } 53 | end 54 | { 55 | } 56 | } 57 | 58 | Export-ModuleMember Get-Member -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-List/Get-List.ps1: -------------------------------------------------------------------------------- 1 | function Get-List { 2 | <# 3 | .Synopsis 4 | Gets all lists on a Trello board. 5 | .Description 6 | Gets all lists on a Trello board. 7 | #> 8 | [CmdletBinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2, 23 | ParameterSetName="Name" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$false, 28 | Position=2, 29 | ParameterSetName="All" 30 | )] 31 | [switch]$All = $true 32 | ) 33 | begin 34 | { 35 | } 36 | process 37 | { 38 | try 39 | { 40 | $Query = Invoke-RestMethod ("https://api.trello.com/1/boards/$($Id)/lists/?token=$($Token.Token)&key=$($Token.AccessKey)") 41 | switch ($PsCmdlet.ParameterSetName) 42 | { 43 | "Name" { $Query | Where-Object {$_.name -eq $Name}; break } 44 | "All" { $Query; break } 45 | default { $Query; break } 46 | } 47 | } 48 | catch 49 | { 50 | Write-Error $_ 51 | } 52 | } 53 | end 54 | { 55 | } 56 | } 57 | 58 | Export-ModuleMember Get-List -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Checklist/Get-Checklist.ps1: -------------------------------------------------------------------------------- 1 | function Get-CheckList { 2 | <# 3 | .Synopsis 4 | Gets all Checklists in a Trello card. 5 | .Description 6 | Gets all Checklists in a Trello card. 7 | #> 8 | [CmdletBinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2, 23 | ParameterSetName="List" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$true, 28 | Position=2, 29 | ParameterSetName="All" 30 | )] 31 | [switch]$All 32 | ) 33 | begin 34 | { 35 | } 36 | process 37 | { 38 | try 39 | { 40 | $Query = Invoke-RestMethod -Uri "https://api.trello.com/1/cards/$($Id)/checklists?token=$($Token.Token)&key=$($Token.AccessKey)" 41 | switch ($PsCmdlet.ParameterSetName) 42 | { 43 | "Name" { $Query | Where-Object { $_.name -eq $Name }; break } 44 | "All" { $Query; break } 45 | default { $Query; break } 46 | } 47 | } 48 | catch 49 | { 50 | Write-Error $_ 51 | } 52 | } 53 | end 54 | { 55 | } 56 | } 57 | 58 | Export-ModuleMember Get-Checklist -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Attachment/Get-Attachment.ps1: -------------------------------------------------------------------------------- 1 | function Get-Attachment { 2 | <# 3 | .Synopsis 4 | Gets a Trello Checklists Item. 5 | .Description 6 | Adds a Trello Checklists Item. 7 | #> 8 | [cmdletbinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$false, 22 | Position=2, 23 | ParameterSetName="Name" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$false, 28 | Position=2, 29 | ParameterSetName="All" 30 | )] 31 | [switch]$All = $false 32 | ) 33 | begin 34 | { 35 | } 36 | process 37 | { 38 | try 39 | { 40 | $Query = Invoke-RestMethod -Method "Get" -Uri "https://api.trello.com/1/cards/$($Id)/attachments?token=$($Token.Token)&key=$($Token.AccessKey)" 41 | switch ($PsCmdlet.ParameterSetName) 42 | { 43 | "Name" { $Query | Where-Object { $_.name -eq $Name }; break } 44 | "All" { $Query; break } 45 | default { $Query; break } 46 | } 47 | } 48 | catch 49 | { 50 | Write-Error $_ 51 | } 52 | } 53 | end 54 | { 55 | } 56 | } 57 | 58 | Export-ModuleMember Get-Attachment -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-ChecklistItem/Get-ChecklistItem.ps1: -------------------------------------------------------------------------------- 1 | function Get-ChecklistItem { 2 | <# 3 | .Synopsis 4 | Gets a Trello Checklists Item. 5 | .Description 6 | Adds a Trello Checklists Item. 7 | #> 8 | [cmdletbinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$false, 22 | Position=2, 23 | ParameterSetName="Name" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$false, 28 | Position=2, 29 | ParameterSetName="All" 30 | )] 31 | [switch]$All = $false 32 | ) 33 | begin 34 | { 35 | } 36 | process 37 | { 38 | try 39 | { 40 | $Query = Invoke-RestMethod -Method "Get" -Uri "https://api.trello.com/1/checklists/$($Id)/checkitems?token=$($Token.Token)&key=$($Token.AccessKey)" 41 | switch ($PsCmdlet.ParameterSetName) 42 | { 43 | "Name" { $Query | Where-Object { $_.name -eq $Name }; break } 44 | "All" { $Query; break } 45 | default { $Query; break } 46 | } 47 | } 48 | catch 49 | { 50 | Write-Error $_ 51 | } 52 | } 53 | end 54 | { 55 | } 56 | } 57 | 58 | Export-ModuleMember Get-ChecklistItem -------------------------------------------------------------------------------- /1.0.1.25/Functions/Add-ChecklistItem/Add-ChecklistItem.ps1: -------------------------------------------------------------------------------- 1 | function Add-ChecklistItem { 2 | <# 3 | .Synopsis 4 | Adds a new Item to a Trello Checklists. 5 | .Description 6 | Adds a new Item to a Trello Checklists. 7 | #> 8 | [cmdletbinding()] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | [string]$Name, 25 | [parameter( 26 | Mandatory=$false, 27 | Position=2 28 | )] 29 | [ValidateSet("true","false")] 30 | [string]$Checked = "false", 31 | [parameter( 32 | Mandatory=$false, 33 | Position=3 34 | )] 35 | [ValidateSet("top","bottom")] 36 | [string]$Position = "bottom" 37 | ) 38 | begin 39 | { 40 | } 41 | process 42 | { 43 | try 44 | { 45 | $Hash = @{ 46 | "name" = $Name 47 | "pos" = $Position 48 | "checked" = $checked 49 | } 50 | Invoke-RestMethod -Method "Post" -Uri "https://api.trello.com/1/checklists/$($Id)/checkitems?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 51 | } 52 | catch 53 | { 54 | Write-Error $_ 55 | } 56 | } 57 | end 58 | { 59 | } 60 | } 61 | 62 | Export-ModuleMember Add-Checklistitem -------------------------------------------------------------------------------- /1.0.1.25/Functions/New-Card/New-Card.ps1: -------------------------------------------------------------------------------- 1 | function New-Card { 2 | <# 3 | .Synopsis 4 | Adds a new Trello Card. 5 | .Description 6 | Adds a new Trello Card. 7 | #> 8 | [cmdletbinding()] 9 | param ( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | $Name, 25 | [parameter( 26 | Mandatory=$true, 27 | Position=3 28 | )] 29 | $Description, 30 | [parameter( 31 | Mandatory=$false, 32 | Position=4 33 | )] 34 | [string[]]$Label, 35 | [parameter( 36 | Mandatory=$false, 37 | Position=5 38 | )] 39 | [ValidateSet("top","bottom")] 40 | $Position = "bottom" 41 | ) 42 | begin 43 | { 44 | } 45 | process 46 | { 47 | [hashtable]$Hash = @{ 48 | "name" = $Name 49 | "desc" = $Description 50 | "idList" = $id 51 | "due" = $null 52 | "urlSource" = $null 53 | "idLabels" = $($Label -join ",") 54 | } 55 | try { 56 | Invoke-RestMethod -Method "Post" -Uri "https://api.trello.com/1/cards/?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 57 | } 58 | catch 59 | { 60 | Write-Error $_ 61 | } 62 | } 63 | end 64 | { 65 | } 66 | } 67 | 68 | Export-ModuleMember New-Card -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Card/Get-Card.ps1: -------------------------------------------------------------------------------- 1 | function Get-Card { 2 | <# 3 | .Synopsis 4 | Gets all cards on a Trello board. 5 | .Description 6 | Gets all cards on a Trello board. 7 | #> 8 | [CmdletBinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Id, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2, 23 | ParameterSetName="Name" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$true, 28 | Position=2, 29 | ParameterSetName="List" 30 | )] 31 | $List, 32 | [parameter( 33 | Mandatory=$true, 34 | Position=2, 35 | ParameterSetName="All" 36 | )] 37 | [switch]$All 38 | ) 39 | begin 40 | { 41 | } 42 | process 43 | { 44 | try 45 | { 46 | $Query = Invoke-RestMethod ("https://api.trello.com/1/boards/$($Id)/cards/?token=$($Token.Token)&key=$($Token.AccessKey)") 47 | switch ($PsCmdlet.ParameterSetName) 48 | { 49 | "Name" { $Query | Where-Object { $_.name -eq $Name }; break } 50 | "List" { $Query | Where-Object { $_.idList -eq $List.id }; break } 51 | "All" { $Query; break } 52 | default { $Query; break } 53 | } 54 | } 55 | catch 56 | { 57 | Write-Error $_ 58 | } 59 | } 60 | end 61 | { 62 | } 63 | } 64 | 65 | Export-ModuleMember Get-Card -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Label/Get-Label.ps1: -------------------------------------------------------------------------------- 1 | function Get-Label { 2 | <# 3 | .Synopsis 4 | Gets all labels on a Trello board. 5 | .Description 6 | Gets all labels on a Trello board. 7 | #> 8 | [CmdletBinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | $Id, 20 | [parameter( 21 | Mandatory=$false, 22 | Position=2, 23 | ParameterSetName="Name" 24 | )] 25 | [string]$Name, 26 | [parameter( 27 | Mandatory=$false, 28 | Position=2, 29 | ParameterSetName="Color" 30 | )] 31 | [ValidateSet("yellow","sky","red","purple","pink","orange","lime","green","blue","black")] 32 | [string]$Color, 33 | [parameter( 34 | Mandatory=$false, 35 | Position=2, 36 | ParameterSetName="All" 37 | )] 38 | [switch]$All 39 | ) 40 | begin 41 | { 42 | } 43 | process 44 | { 45 | try 46 | { 47 | $Query = Invoke-RestMethod ("https://api.trello.com/1/boards/$($id)/labels/?token=$($Token.Token)&key=$($Token.AccessKey)") 48 | switch ($PsCmdlet.ParameterSetName) 49 | { 50 | "Name" { $Query | Where-Object { $_.name -eq $Name }; break } 51 | "Color" { $Query | Where-Object { $_.color -eq $Color }; break } 52 | "All" { $Query; break } 53 | default { $Query; break } 54 | } 55 | } 56 | catch 57 | { 58 | Write-Error 59 | } 60 | } 61 | end 62 | { 63 | } 64 | } 65 | 66 | Export-ModuleMember Get-Label -------------------------------------------------------------------------------- /1.0.1.25/Tests/appveyor.pester.ps1: -------------------------------------------------------------------------------- 1 | param([switch]$Finalize) 2 | 3 | $PSVersion = $PSVersionTable.PSVersion.Major 4 | $TestFile = "TestResults_PS$PSVersion.xml" 5 | $ProjectRoot = $ENV:APPVEYOR_BUILD_FOLDER 6 | Set-Location $ProjectRoot 7 | #Run a test with the native version of PowerShell 8 | if(-not $Finalize) 9 | { 10 | "`tSTATUS: Testing with PowerShell $PSVersion" 11 | Import-Module Pester 12 | Invoke-Pester -Path "$ProjectRoot\Tests" -OutputFormat NUnitXml -OutputFile "$ProjectRoot\$TestFile" -PassThru | Export-Clixml -Path "$ProjectRoot\PesterResults_PS$PSVersion.xml" 13 | } else { 14 | #Show status... 15 | $AllFiles = Get-ChildItem -Path $ProjectRoot\*Results*.xml | Select-Object -ExpandProperty FullName 16 | "`tSTATUS: Finalizing results" 17 | "COLLATING FILES:`n$($AllFiles | Out-String)" 18 | #Upload results for test page 19 | Get-ChildItem -Path "$ProjectRoot\TestResults_PS*.xml" | Foreach-Object { 20 | $Address = "https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)" 21 | $Source = $_.FullName 22 | "UPLOADING FILES: $Address $Source" 23 | (New-Object 'System.Net.WebClient').UploadFile( $Address, $Source ) 24 | } 25 | #What failed? 26 | $Results = @( Get-ChildItem -Path "$ProjectRoot\PesterResults_PS*.xml" | Import-Clixml ) 27 | $FailedCount = $Results | Select-Object -ExpandProperty FailedCount | Measure-Object -Sum | Select-Object -ExpandProperty Sum 28 | if ($FailedCount -gt 0) { 29 | $FailedItems = $Results | Select-Object -ExpandProperty TestResult | Where-Object {$_.Passed -notlike $True} 30 | "FAILED TESTS SUMMARY:`n" 31 | $FailedItems | ForEach-Object { 32 | $Test = $_ 33 | [pscustomobject]@{ 34 | Describe = $Test.Describe 35 | Context = $Test.Context 36 | Name = "It $($Test.Name)" 37 | Result = $Test.Result 38 | } 39 | } | Sort-Object -Property Describe, Context, Name, Result | Format-List 40 | throw "$FailedCount tests failed." 41 | } 42 | } -------------------------------------------------------------------------------- /1.0.1.25/Functions/Get-Board/Get-Board.ps1: -------------------------------------------------------------------------------- 1 | function Get-Board { 2 | <# 3 | .Synopsis 4 | Gets all your Trello boards. 5 | .Description 6 | Gets all your Trello boards. 7 | #> 8 | [CmdletBinding(DefaultParameterSetName="All")] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1, 18 | ParameterSetName="Name" 19 | )] 20 | [string]$Name, 21 | [parameter( 22 | Mandatory=$true, 23 | Position=1, 24 | ParameterSetName="Id" 25 | )] 26 | [string]$Id, 27 | [parameter( 28 | Mandatory=$false, 29 | Position=1, 30 | ParameterSetName="All" 31 | )] 32 | [switch]$All, 33 | [parameter( 34 | Mandatory=$false, 35 | Position=2 36 | )] 37 | [ValidateSet("Open","Closed","All")] 38 | [string]$Status = "All" 39 | ) 40 | begin 41 | { 42 | } 43 | process 44 | { 45 | try 46 | { 47 | $Query = Invoke-RestMethod ("https://api.trello.com/1/members/my/boards/?token=$($Token.Token)&key=$($Token.AccessKey)") 48 | switch ($PsCmdlet.ParameterSetName) 49 | { 50 | "Name" 51 | { 52 | $PSNApplied = $Query | Where-Object {$_.name -eq $Name} 53 | break 54 | } 55 | "Id" 56 | { 57 | $PSNApplied = $Query | Where-Object {$_.id -eq $Id} 58 | break 59 | } 60 | "All" 61 | { 62 | $PSNApplied = $Query 63 | break 64 | } 65 | } 66 | switch ($Status) 67 | { 68 | "Open" 69 | { 70 | $PSNApplied | Where-Object {$_.closed -eq $False} 71 | } 72 | "Closed" 73 | { 74 | $PSNApplied | Where-Object {$_.closed -eq $True} 75 | } 76 | "All" 77 | { 78 | $PSNApplied 79 | } 80 | } 81 | } 82 | catch 83 | { 84 | Write-Error $_ 85 | } 86 | } 87 | end 88 | { 89 | } 90 | } 91 | 92 | Export-ModuleMember Get-Board -------------------------------------------------------------------------------- /1.0.1.25/Functions/New-Board/New-Board.ps1: -------------------------------------------------------------------------------- 1 | function New-Board { 2 | <# 3 | .Synopsis 4 | Adds a new Trello Board. 5 | .Description 6 | Adds a new Trello Board. 7 | #> 8 | [cmdletbinding()] 9 | param( 10 | [parameter( 11 | Mandatory=$true, 12 | Position=0 13 | )] 14 | $Token, 15 | [parameter( 16 | Mandatory=$true, 17 | Position=1 18 | )] 19 | [string]$Description, 20 | [parameter( 21 | Mandatory=$true, 22 | Position=2 23 | )] 24 | [string]$Name, 25 | [parameter( 26 | Mandatory=$false, 27 | Position=3 28 | )] 29 | [ValidateSet("calendar","cardAging","recap","voting")] 30 | [string[]]$PowerUps = "All", 31 | [parameter( 32 | Mandatory=$false, 33 | Position=4 34 | )] 35 | [ValidateSet("org","private","public")] 36 | [string]$PermissionLevel, 37 | [parameter( 38 | Mandatory=$false, 39 | Position=5 40 | )] 41 | [ValidateSet("disabled","members","observers","org","public")] 42 | [string]$Voting, 43 | [parameter( 44 | Mandatory=$false, 45 | Position=6 46 | )] 47 | [ValidateSet("disabled","members","observers","org","public")] 48 | [string]$Comments, 49 | [parameter( 50 | Mandatory=$false, 51 | Position=7 52 | )] 53 | [ValidateSet("admins","members")] 54 | [string]$Invitations, 55 | [parameter( 56 | Mandatory=$false, 57 | Position=8 58 | )] 59 | [ValidateSet("true","false")] 60 | [string]$SelfJoin 61 | ) 62 | begin 63 | { 64 | } 65 | process 66 | { 67 | try 68 | { 69 | $Hash = @{ 70 | "name" = $Name 71 | "desc" = $Description 72 | } 73 | switch ($PSBoundParameters.Keys) 74 | { 75 | {$_ -contains "PermissionLevel"} { 76 | $Hash.Add("prefs_permissionLevel",$PermissionLevel) 77 | } 78 | {$_ -contains "Voting"} { 79 | $Hash.Add("prefs_voting",$Voting) 80 | } 81 | {$_ -contains "PowerUps"} { 82 | $PowerUps = $PowerUps -join "," 83 | } 84 | {$_ -contains "Comments"} { 85 | $Hash.Add("prefs_comments",$Comments) 86 | } 87 | {$_ -contains "Invitations"} { 88 | $Hash.Add("prefs_invitations",$Invitations) 89 | } 90 | {$_ -contains "SelfJoin"} { 91 | $Hash.Add("prefs_selfJoin",$SelfJoin) 92 | } 93 | } 94 | $Hash.Add("powerUps",$PowerUps) 95 | Invoke-RestMethod -Method "Post" -Uri "https://api.trello.com/1/boards?token=$($Token.Token)&key=$($Token.AccessKey)" -Body $Hash 96 | } 97 | catch 98 | { 99 | Write-Error $_ 100 | } 101 | } 102 | end 103 | { 104 | } 105 | } 106 | 107 | Export-ModuleMember New-Board -------------------------------------------------------------------------------- /1.0.1.25/Functions/New-Token/New-Token.ps1: -------------------------------------------------------------------------------- 1 | function New-Token { 2 | <# 3 | .Synopsis 4 | Logs into Trello and returns a token that may be used to make calls. 5 | .Description 6 | Logs into Trello and returns a token that may be used to make calls. Use with other commands to work with private boards 7 | .Parameter BoardId 8 | The id of the board 9 | .Example 10 | # Get all cards on a private board 11 | $auth = New-TrelloToken -Key abc -AppName "My App" 12 | Get-TrelloCardsInBoard -BoardId fDsPBXFt -Token $auth 13 | #> 14 | [cmdletbinding()] 15 | param( 16 | [Parameter( 17 | Mandatory=$true, 18 | Position=0 19 | )] 20 | $Key, 21 | [Parameter( 22 | Mandatory=$true, 23 | Position=1 24 | )] 25 | $AppName, 26 | [Parameter( 27 | Mandatory=$false, 28 | Position=2 29 | )] 30 | $Expiration="30days", 31 | [Parameter( 32 | Mandatory=$false, 33 | Position=3 34 | )] 35 | [ValidateSet("read","read,write")] 36 | $Scope="read" 37 | ) 38 | begin 39 | { 40 | function Get-oAuth2AccessToken { 41 | <# 42 | .Synopsis 43 | Retrieves an oAuth 2.0 access token from the specified base authorization 44 | URL, client application ID, and callback URL. 45 | 46 | .Parameter AuthUrl 47 | The base authorization URL defined by the service provider. 48 | 49 | .Parameter ClientId 50 | The client ID (aka. app ID, consumer ID, etc.). 51 | 52 | .Parameter RedirectUri 53 | The callback URL configured on your application's registration with the 54 | service provider. 55 | 56 | .Parameter SleepInterval 57 | The number of seconds to sleep while waiting for the user to authorize the 58 | application. 59 | 60 | .Parameter Scope 61 | A string array of "scopes" (permissions) that your application will be 62 | requesting from the user's account. 63 | #> 64 | [CmdletBinding()] 65 | param ( 66 | [Parameter( 67 | Mandatory=$true, 68 | Position=0 69 | )] 70 | [string]$AuthUrl, 71 | [Parameter( 72 | Mandatory=$false, 73 | Position=1 74 | )] 75 | [int]$SleepInterval = 2 76 | ) 77 | begin 78 | { 79 | try { 80 | # Create the Internet Explorer object 81 | $IE = New-Object -ComObject InternetExplorer.Application 82 | $IE.Visible = $true 83 | } 84 | catch 85 | { 86 | Write-Error $_ 87 | } 88 | } 89 | process 90 | { 91 | try { 92 | # Navigate to the constructed authorization URL 93 | $IE.Navigate($AuthUrl) 94 | 95 | # Sleep the script for $X seconds until callback URL has been reached 96 | # NOTE: If user cancels authorization, this condition will not be satisifed 97 | while ($IE.LocationUrl -notmatch ‘token=’) { 98 | Write-Debug -Message (‘Sleeping {0} seconds for access URL’ -f $SleepInterval) 99 | Start-Sleep -Seconds $SleepInterval 100 | } 101 | 102 | # Parse the access token from the callback URL and exit Internet Explorer 103 | Write-Debug -Message (‘Callback URL is: {0}’ -f $IE.LocationUrl) 104 | [Void]($IE.LocationUrl -match ‘=([\w\.]+)’) 105 | $AccessToken = $Matches[1] 106 | 107 | # Write the access token to the pipeline inside of a HashTable (in case we want to return other properties later) 108 | Write-Debug -Message (‘Access token is: {0}’ -f $AccessToken) 109 | } 110 | catch 111 | { 112 | Write-Error $_ 113 | } 114 | Write-Output $AccessToken 115 | } 116 | end 117 | { 118 | try { 119 | $IE.Quit() 120 | } 121 | catch 122 | { 123 | Write-Error $_ 124 | } 125 | } 126 | } 127 | } 128 | process 129 | { 130 | $Output = @{} 131 | try 132 | { 133 | [string]$token = Get-oAuth2AccessToken -AuthUrl "https://trello.com/1/authorize?key=$Key&name=$AppName&expiration=$Expiration&scope=$Scope&response_type=token&callback_method=fragment&return_url=https://trello.com?" 134 | 135 | $Output.Add("Token",$token.Replace(' ','')) 136 | $Output.Add("AccessKey",$Key) 137 | } 138 | catch 139 | { 140 | Write-Error $_ 141 | } 142 | Write-Output $Output 143 | } 144 | end 145 | { 146 | } 147 | } 148 | 149 | Export-ModuleMember New-Token -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **TrellOps** 2 | This Windows PowerShell module is for the management of Trello. 3 | 4 |
28th of May, 2016: Help and examples for this module uploaded. 5 | 21st of August, 2017: Added Get-TrelloSecret and Get-TrelloKey6 | 7 | ##### Written by: Jeff Wouters 8 | 9 | ## Example 10 | This is an example on how you can use this Windows PowerShell module in order to manage your Trello environment. 11 | 12 | ###Get your secret 13 |
$Secret = Get-TrelloSecret
14 |
15 | ##Get your key
16 | $Key = Get-TrelloKey
17 |
18 | ##Get your token
19 | $AuthRead = New-TrelloToken -Key $Key -AppName "TrellOpsRead" -Expiration "never" -Scope 'read'
20 | $AuthWrite = New-TrelloToken -Key $Key -AppName "TrellOpsWrite" -Expiration "never" -Scope 'read,write'
21 |
22 | Get-TrelloBoard -Token $AuthRead -All
23 |
24 | ####Create a board
25 | $TrelloBoard = New-TrelloBoard -Token $AuthWrite -Name "MethosIT - Demo" -Description "This is demo board of Methos IT"
26 |
27 | ####Create lists on the board
28 | $TrelloBoardList_UnprioritisedBacklog = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Un-prioritised Backlog" -Position "bottom"
29 | $TrelloBoardList_Backlog = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Backlog" -Position "bottom"
30 | $TrelloBoardList_Sprint = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Sprint" -Position "bottom"
31 | $TrelloBoardList_WIP = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "WIP (Work in Progress)" -Position "bottom"
32 | $TrelloBoardList_Done = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Done" -Position "bottom"
33 | $TrelloBoardList_Impediments = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Impediments" -Position "bottom"
34 |
35 | ####Create labels on the board
36 | $TrelloBoardLabel_Daily = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Daily" -Color "red"
37 | $TrelloBoardLabel_Weekly = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Weekly" -Color "blue"
38 | $TrelloBoardLabel_Monthly = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Monthly" -Color "black"
39 |
40 | ####Create cards in the lists
41 | $NewTrelloCard = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard" -Description "Just some description" -Label $TrelloBoardLabel_Daily.id -Position "bottom"
42 | $NewTrelloCard2 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard2" -Description "Just some description" -Label $TrelloBoardLabel_Weekly.id -Position "bottom"
43 | $NewTrelloCard3 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard3" -Description "Just some description" -Label $TrelloBoardLabel_Weekly.id -Position "bottom"
44 | $NewTrelloCard4 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard4" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
45 | $NewTrelloCard5 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard5" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
46 | $NewTrelloCard6 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard6" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
47 | $NewTrelloCard7 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard7" -Description "Just some description" -Position "bottom"
48 |
49 | ####Create a checklist in a card
50 | $TrelloCardChecklist = Add-TrelloChecklist -Token $AuthWrite -Id $NewTrelloCard.id -Name "Checklist" -Position "top"
51 |
52 | ####Create items in the checklist
53 |
54 | $TrelloCardChecklistItem1 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is my rifle,"
55 | $TrelloCardChecklistItem2 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is my gun."
56 | $TrelloCardChecklistItem3 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is for fighting,"
57 | $TrelloCardChecklistItem4 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is for fun."
58 |
59 | ####Add an attachment to a card
60 | $TrelloCardAttachment = Add-TrelloAttachment -Token $AuthWrite -Id $NewTrelloCard.id -Name "Some attachment" -Url "http://www.desktopbackgroundsi.net/wp-content/uploads/Picture_6.jpg"
61 | $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"
62 |
63 |
64 | ## Clean up the demo board
65 | #Remove what you've created
66 |
67 | ####Remove items from a checklist
68 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem4.id
69 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem3.id
70 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem2.id
71 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem1.id
72 |
73 | ####Remove checklist
74 | Remove-TrelloChecklist -Token $AuthWrite -Id $TrelloCardChecklist.id
75 |
76 | ####Remove attachment from a card
77 | Remove-TrelloAttachment -Token $AuthWrite -Id $TrelloCardAttachment.id -CardId $NewTrelloCard.id
78 | Remove-TrelloAttachment -Token $AuthWrite -Id $TrelloCardAttachment2.id -CardId $NewTrelloCard7.id
79 |
80 | ####Remove cards
81 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard7.id
82 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard6.id
83 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard5.id
84 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard4.id
85 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard3.id
86 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard2.id
87 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard.id
88 |
89 | ####Remove labels
90 | Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Daily.id
91 | Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Weekkly.id
92 | Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Monthly.id
--------------------------------------------------------------------------------
/1.0.1.25/README.md:
--------------------------------------------------------------------------------
1 | [](https://ci.appveyor.com/project/MethosIT/trellops)
2 | # **TrellOps**
3 | This Windows PowerShell is for the management of Trello.
4 | Help and examples for this module will be uploaded on the 28th of May 2016.
5 |
6 | ##### Written by: Jeff Wouters
7 |
8 | ## Example
9 | This is an example on how you can use this Windows PowerShell module in order to manage your Trello environment.
10 |
11 | ###Get your token
12 | Get your secret and key from here: https://trello.com/app-key
13 | $Secret = "YourSecret"
14 | $Key = "YourKey"
15 |
16 | $AuthRead = New-TrelloToken -Key $Key -AppName "TrellOpsRead" -Expiration "never" -Scope 'read'
17 | $AuthWrite = New-TrelloToken -Key $Key -AppName "TrellOpsWrite" -Expiration "never" -Scope 'read,write'
18 |
19 | Get-TrelloBoard -Token $AuthRead -All
20 |
21 | ####Create a board
22 | $TrelloBoard = New-TrelloBoard -Token $AuthWrite -Name "MethosIT - Demo" -Description "This is demo board of Methos IT"
23 |
24 | ####Create lists on the board
25 | $TrelloBoardList_UnprioritisedBacklog = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Un-prioritised Backlog" -Position "bottom"
26 | $TrelloBoardList_Backlog = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Backlog" -Position "bottom"
27 | $TrelloBoardList_Sprint = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Sprint" -Position "bottom"
28 | $TrelloBoardList_WIP = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "WIP (Work in Progress)" -Position "bottom"
29 | $TrelloBoardList_Done = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Done" -Position "bottom"
30 | $TrelloBoardList_Impediments = New-TrelloList -Token $AuthWrite -Id $TrelloBoard.id -Name "Impediments" -Position "bottom"
31 |
32 | ####Create labels on the board
33 | $TrelloBoardLabel_Daily = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Daily" -Color "red"
34 | $TrelloBoardLabel_Weekly = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Weekly" -Color "blue"
35 | $TrelloBoardLabel_Monthly = New-TrelloLabel -Token $AuthWrite -Id $Trelloboard.id -Name "Monthly" -Color "black"
36 |
37 | ####Create cards in the lists
38 | $NewTrelloCard = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard" -Description "Just some description" -Label $TrelloBoardLabel_Daily.id -Position "bottom"
39 | $NewTrelloCard2 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard2" -Description "Just some description" -Label $TrelloBoardLabel_Weekly.id -Position "bottom"
40 | $NewTrelloCard3 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard3" -Description "Just some description" -Label $TrelloBoardLabel_Weekly.id -Position "bottom"
41 | $NewTrelloCard4 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard4" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
42 | $NewTrelloCard5 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard5" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
43 | $NewTrelloCard6 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard6" -Description "Just some description" -Label $TrelloBoardLabel_Monthly.id -Position "bottom"
44 | $NewTrelloCard7 = New-TrelloCard -Token $AuthWrite -Id $TrelloBoardList_Backlog.id -Name "TestCard7" -Description "Just some description" -Position "bottom"
45 |
46 | ####Create a checklist in a card
47 | $TrelloCardChecklist = Add-TrelloChecklist -Token $AuthWrite -Id $NewTrelloCard.id -Name "Checklist" -Position "top"
48 |
49 | ####Create items in the checklist
50 |
51 | $TrelloCardChecklistItem1 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is my rifle,"
52 | $TrelloCardChecklistItem2 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is my gun."
53 | $TrelloCardChecklistItem3 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is for fighting,"
54 | $TrelloCardChecklistItem4 = Add-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -Name "This is for fun."
55 |
56 | ####Add an attachment to a card
57 | $TrelloCardAttachment = Add-TrelloAttachment -Token $AuthWrite -Id $NewTrelloCard.id -Name "Some attachment" -Url "http://www.desktopbackgroundsi.net/wp-content/uploads/Picture_6.jpg"
58 | $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"
59 |
60 |
61 | ## Clean up the demo board
62 | #Remove what you've created
63 |
64 | ####Remove items from a checklist
65 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem4.id
66 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem3.id
67 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem2.id
68 | Remove-TrelloChecklistItem -Token $AuthWrite -Id $TrelloCardChecklist.id -ItemId $TrelloCardChecklistItem1.id
69 |
70 | ####Remove checklist
71 | Remove-TrelloChecklist -Token $AuthWrite -Id $TrelloCardChecklist.id
72 |
73 | ####Remove attachment from a card
74 | Remove-TrelloAttachment -Token $AuthWrite -Id $TrelloCardAttachment.id -CardId $NewTrelloCard.id
75 | Remove-TrelloAttachment -Token $AuthWrite -Id $TrelloCardAttachment2.id -CardId $NewTrelloCard7.id
76 |
77 | ####Remove cards
78 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard7.id
79 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard6.id
80 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard5.id
81 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard4.id
82 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard3.id
83 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard2.id
84 | Remove-TrelloCard -Token $AuthWrite -Id $NewTrelloCard.id
85 |
86 | ####Remove labels
87 | Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Daily.id
88 | Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Weekkly.id
89 | Remove-TrelloLabel -Token $AuthWrite -Id $TrelloBoardLabel_Monthly.id
--------------------------------------------------------------------------------