Hi Folke
My final solution (workaround) in this case was to update the guide directly in the database, below some snippets from my Powershell script.
I have to say, that this is very dangerous and can lead to a corrupt database if you're doing something wrong! So be very careful with this!!
$global:PasswordstateSystemWideAPIKey = '';
Import-Module SQLPS -DisableNameChecking
Push-Location
cd SQLSERVER:\SQL\localhost\DEFAULT\Databases\passwordstate
Function UpdateGuideOfPasswordstatePasswordlistOrFolder() {
Param (
[Parameter(Mandatory=$True,ValueFromPipeline=$False,ValueFromPipelinebyPropertyName=$False)]
[String]$Id,
[Parameter(Mandatory=$False,ValueFromPipeline=$False,ValueFromPipelinebyPropertyName=$False)]
[String]$Guide
)
Begin {
$Guide = ConvertTextToHtml -text $Guide
}
Process {
$Header = @{
APIKey = $global:PasswordstateSystemWideAPIKey
}
try {
$query = $("UPDATE PasswordLists SET Guide = '" + $Guide + "' WHERE PasswordListID = " + $ID)
Invoke-Sqlcmd -Query $query
} catch {
Write-Host $_ -ForegroundColor Red
Write-Host $_.GetType() -ForegroundColor Red
Write-Host $_.Exception -ForegroundColor Red
throw $_.Exception
}
}
End {
Write-Output ($result | Where-Object { $_.TreePath -eq $Tree }).PasswordListID
}
}
Function ConvertTextToHtml() {
Param (
[Parameter(Mandatory=$True,ValueFromPipeline=$False,ValueFromPipelinebyPropertyName=$False)]
[String]$text
)
Begin { }
Process {
$html = $($text -replace "\n", "<br>")
}
End {
Write-Output $html
}
}
$dummyGuide = @"
This
Is
A
Test
Guide
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
"@
UpdateGuideOfPasswordstatePasswordlistOrFolder -Id 123456789 -Guide $dummyGuide
Pop-Location
Best regards,
Fabian