Skip to content

Commit

Permalink
updated the help documentation of the functions
Browse files Browse the repository at this point in the history
implements AtlassianPS#16
  • Loading branch information
lipkau committed Apr 8, 2017
1 parent 53902e5 commit 4eca26e
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 39 deletions.
10 changes: 5 additions & 5 deletions ConfluencePS/Public/Get-WikiPage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
Fetch Confluence pages, optionally filtering by Name/Space/ID.
Piped output into other cmdlets is generally tested and supported.
.EXAMPLE
Get-WikiPage -Title Confluence -Limit 100
Get all pages with the word Confluence in the title. Title is not case sensitive.
Among only the first 100 pages found, returns all results matching *confluence*.
.EXAMPLE
Get-WikiPage -Limit 500 | Select-Object ID, Title | Sort-Object Title
List the first 500 pages found in your Confluence instance.
Returns only each page's ID and Title, sorting results alphabetically by Title.
.EXAMPLE
Get-WikiPage -Title Confluence -Limit 100
Get all pages with the word Confluence in the title. Title is not case sensitive.
Among only the first 100 pages found, returns all results matching *confluence*.
.EXAMPLE
Get-WikiSpace -Name Demo | Get-WikiPage
Get all spaces with a name like *demo*, and then list pages from each returned space.
Expand Down
14 changes: 7 additions & 7 deletions ConfluencePS/Public/Get-WikiSpace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
Piped output into other cmdlets is generally tested and supported.
.EXAMPLE
Get-WikiSpace -ID 123456
Display the info of the space with ID 123456.
Get-WikiSpace
Display the info of all spaces on the server.
.EXAMPLE
Get-WikiSpace -Name test
Display all spaces containing 'test' in the name.
Get-WikiSpace -SpaceKey NASA
Display the info of the space with key "NASA".
.LINK
https://github.com/brianbunke/ConfluencePS
#>
[CmdletBinding()]
param (
[CmdletBinding()]
param (
# Filter results by key. Supports wildcard matching on partial input.
[Alias('Key')]
[string]$SpaceKey,

# Defaults to 25 max results; can be modified here.
[ValidateRange(1,[int]::MaxValue)]
[ValidateRange(1, [int]::MaxValue)]
[int]$Limit
)

Expand Down
24 changes: 13 additions & 11 deletions ConfluencePS/Public/New-WikiPage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ function New-WikiPage {
Content needs to be in "Confluence storage format;" see also -Convert.
.EXAMPLE
New-WikiPage -Title 'Test New Page' -ParentID 123456 -Body '<p>Hello world</p>' -WhatIf
Creates a new test page (as a child member of existing page 123456) with one line of page text.
Automatically finds 123456 in space 'ABC' via Get-WikiPage and applies the key to the REST post.
-WhatIf support, so the page will not actually be created.
New-WikiPage -Title "My new fance Page" -Body "<h1>My Title</h1><p>The body of my fancy new page.</p>"
Creates a new page with a given title and body content (in "confluence's storeage format").
The information of the created page is returned to the console.
.EXAMPLE
New-WikiPage -Title 'Test New Page' -ParentID 123456 -Body 'Hello world' -Convert -WhatIf
Creates a new page as a child member of existing page 123456 with one line of page text.
The Body defined is converted to Storage fromat by the "-Convert" parameter
.EXAMPLE
Get-WikiPage -Title 'Darth Vader' | New-WikiPage -Title 'Luke Skywalker' -Body $Body -Confirm
Searches for pages named *Darth Vader*, pipes page ID and space key. New page is a child of existing page.
Note that this can grab multiple pages via wildcard matching, potentially attempting multiple posts.
You will be asked to confirm each creation. Choose wisely.
New-WikiPage -Title "Luke Skywalker" -Parent (Get-WikiPage -title "Darth Vader" -SpaceKey "STARWARS")
Creates a new page with an empty body as a child page of the "Parent Page" in the "space" page.
.EXAMPLE
New-WikiPage -Title 'Loner Page' -SpaceKey TEST -Body $Body -Convert -Verbose
Creates a new page at the root of the specified space (no parent page). Verbose flag enabled.
$Body is not yet in Confluence storage format ("XHTML-based"), and needs to be converted.
[ConfluencePS.Page]@{Title="My Title";Space=[ConfluencePS.Space]@{Key="ABC"}} | New-WikiPage
Creates a new page "My Title" in the space "ABC" with an empty body.
.LINK
Get-WikiPage
Expand Down
7 changes: 4 additions & 3 deletions ConfluencePS/Public/New-WikiSpace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Create a new blank space. Key and Name mandatory, Description recommended.
.EXAMPLE
New-WikiSpace -Key 'TEST' -Name 'Test Space'
[ConfluencePS.Space]@{key="TEST";Name="Test Space"} | New-WikiSpace
Create the new blank space. Runs Set-WikiInfo first if instance info unknown.
.EXAMPLE
Expand All @@ -18,10 +18,11 @@
https://github.com/brianbunke/ConfluencePS
#>
[CmdletBinding(
ConfirmImpact = 'Medium',
SupportsShouldProcess = $true,
DefaultParameterSetName = "byObject",
ConfirmImpact = 'Medium'
DefaultParameterSetName = "byObject"
)]
[OutputType([ConfluencePS.Space])]
param (
# Space Object
[Parameter(
Expand Down
5 changes: 2 additions & 3 deletions ConfluencePS/Public/Remove-WikiLabel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
Verbose and Confirm flags both active.
.EXAMPLE
Get-WikiLabelApplied -Label asdf -Limit 100 | Remove-WikiLabel -Label asdf -WhatIf
Would remove the label "asdf" from all of your Confluence pages. -WhatIf flag supported.
This may not remove everything if the max result limit for Get-WikiLabelApplied is reached.
Get-WikiPage -SpaceKey "ABC" | Remove-WikiLabel -Label asdf -WhatIf
Would remove the label "asdf" from all pages in the ABC space.
.LINK
https://github.com/brianbunke/ConfluencePS
Expand Down
7 changes: 3 additions & 4 deletions ConfluencePS/Public/Remove-WikiPage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
Untested against non-page content, but probably works anyway.
.EXAMPLE
Get-WikiSpace -Key SESAME | Get-WikiPage -Title Oscar | Remove-WikiPage -Confirm
Get-WikiPage -Title Oscar | Remove-WikiPage -Confirm
Send Oscar to the trash. Each matching page will ask you to confirm the deletion.
.EXAMPLE
Get-WikiLabelApplied -Label outdated -Limit 100 | Remove-WikiPage -Verbose -WhatIf
Find the first 100 content results that are labeled "outdated."
Would remove each page one by one with verbose output; -WhatIf flag active.
Remove-WikiPage -PageID 12345,12346 -Verbose -WhatIf
Simulates the removal of two specifc pages.
.LINK
https://github.com/brianbunke/ConfluencePS
Expand Down
12 changes: 6 additions & 6 deletions ConfluencePS/Public/Remove-WikiSpace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"The space is deleted in a long running task, so the space cannot be considered deleted when this resource returns."
.EXAMPLE
Remove-WikiSpace -Key XYZ -Confirm
Delete a space with key XYZ (note that key != name). Confirm will prompt before deletion.
Remove-WikiSpace -Key ABC,XYZ -Confirm
Delete the space with key ABC and with key XYZ (note that key != name). Confirm will prompt before deletion.
.EXAMPLE
Get-WikiSpace -Name ald | Remove-WikiSpace -Verbose -WhatIf
Get spaces matching '*ald*' (like Reginald and Alderaan), piping them to be deleted.
Would remove each space one by one with verbose output; -WhatIf flag active.
Get-WikiSpace | Where {$_.Name -like "*old"} | Remove-WikiSpace -Verbose -WhatIf
Get all spaces ending in 'old' and simulate the deletion of them.
Would simulate the removal of each space one by one with verbose output; -WhatIf flag active.
.LINK
https://github.com/brianbunke/ConfluencePS
Expand All @@ -35,7 +35,7 @@
[Alias('Key')]
[string[]]$SpaceKey

# Probably an extra param later to loop checking the status & wait for completion?
# TODO: Probably an extra param later to loop checking the status & wait for completion?
)

BEGIN {
Expand Down

0 comments on commit 4eca26e

Please sign in to comment.