iainbrighton / PScribo

PowerShell documentation framework
MIT License
232 stars 35 forks source link

Import existing Doc's #26

Closed kilasuit closed 7 years ago

kilasuit commented 8 years ago

It would be a pretty cool feature to be able to import an existing document into a PScribo document Object and make use of PScribo to then update the document (or a small section of it)

I certainly have a usecase for this at my current client to update existing documentation as the production environment grows.

iainbrighton commented 8 years ago

This is what I do:

$doc = Document {
    Paragraph 'This is just an example'
}
$doc | Export-CliXml -Path .\DocumentBackup.xml -Depth 100

Once you've reimported, you can manipulate the document model as you need. Do you have a specific example?

kilasuit commented 8 years ago

It's more for when working with an existing document that wasn't created using PScribo so there would be a need for an Import-Document and subsequent additional functions too.

iainbrighton commented 8 years ago

Ahh! Yeah I doubt that's ever going to get implemented 😢. There are simply too many variables across each document type. Updating an existing PScribo document (it's just a PSCustomObject) should be possible, e.g. adding a new section or removing an existing section/paragraph etc.