How to Download a Page from Confluence with PowerShell

I was looking about on the net for "how to download a page from Confluence with PowerShell" and came across various Linux resources. Alas, I don't have access to a Linux box, just whatever I can do from my Enterprise locked down Windows Virtual Desktop. The good news is that it isn't at all difficult but you need to have curl.exe available to you.

$Curl = curl.exe -u USERNAME:PASSWORD https://YOUR_CONFLUENCE_WEBSITE/PATH1/PATH2/PAGE_YOU_WANT?expand=body.storage

And that's it!

The contents of $Curl will be in HTML format. $Curl will be a [System.Array] and you'll need to process it as:

$Curl | Foreach{
... process/parse the HTML to get out what you want ...
}

Not particularly difficult to parse HTML. I needed to get some table data and it was pretty straightforward to find the relevant HTML and process it.

Links I came across:



Comments