{"Name":"Dynamic Folder Export","Objects":[{"Type":"DynamicFolder","Name":"PasswordState","Notes":"\n\n\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\t

 

\n\n","ScriptInterpreter":"powershell","DynamicCredentialScriptInterpreter":"json","Script":"$ErrorActionPreference = \"Stop\"\n$results = Get-PasswordStateResource -uri \"/api/searchpasswords/?search=%&PreventAuditing=true\"\n$credentials = @()\nforeach ($item in $results) {\n if ($item.Notes -like \"-----BEGIN RSA PRIVATE KEY----*\") {\n $credentials += [pscustomobject]@{\n Type = \"Credential\"\n Name = $item.Title\n Username = $item.Username\n Password = $item.Password\n ID = $item.PasswordID\n KeyFileContent = $item.Notes\n }\n \n }\n else {\n $credentials += [pscustomobject]@{\n Type = \"Credential\"\n Name = $item.Title\n Username = $item.Username\n Password = $item.Password\n ID = $item.PasswordID\n }\n \n }\n}\n\n\n$final = [pscustomobject]@{\n Objects = $credentials\n}\n$final | ConvertTo-Json -Depth 100 | Write-Output"}]}