New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export-CliXml shouldn't require writing to a file #3898
Comments
Given how this distinction is handled in existing cmdlets (e.g., |
Struggling to see the use case for Clixml representation of a an object just in memory. The CliXml cmdlets, as I understand them, are about persisting objects |
There are many different places you might want to persist objects. The filesystem is just one place. |
Just came across a decent use case for this... Environment variables currently on take strings, so storing a complex object as an environment variable is not really possible. But if Export-Clixml could export a string to an environment variable, then we could relatively easily use Import-Clixml to re-hydrate the object. |
If this followed the convention of CSV, it would actually be better to have a |
Building on top of what @markekraus mentioned, another use case would be sending the CLIXML off to a message queue for processing by a different consumer application. I should not have to write the CLIXML to disk, and then read it again, to accomplish this. |
@powershell/powershell grabbing, if i can? Progress on this: https://github.com/charlieschmidt/PowerShell/tree/powershell-3898-convertfromto-clixml |
…port-Clixml; like Import/Export/ConvertFrom/ConvertTo-Csv) Refactored Export-Clixml into base functionality shared with ConvertTo-Clixml. Import/ConvertFrom-Clixml both use existing ImportXmlHelper class - extended that to create MemoryStream for ConvertFrom- Corresponding pester tests. asdf Closes PowerShell#3898
…port-Clixml; like Import/Export/ConvertFrom/ConvertTo-Csv) Refactored Export-Clixml into base functionality shared with ConvertTo-Clixml. Import/ConvertFrom-Clixml both use existing ImportXmlHelper class - extended that to create MemoryStream for ConvertFrom- Corresponding pester tests. Closes PowerShell#3898
As a simple workaround how about this... `$SerializedString = [System.Management.Automation.PSSerializer]::Serialize($Object) $BackToObject = [System.Management.Automation.PSSerializer]::Deserialize($SerializedString)` |
It's a viable workaround, but I wouldn't call it simple, because this behind-the-scenes type is neither widely known nor easy to remember. As an aside: |
I like to work on this issue. I hope that the cmdlets are still needed. |
I see there was an old PR that never got merged and is now closed... but yeah we can still use this. Go for it! 🙂 |
First of all, thanks to everyone for getting this fixed. Are there any indications on which release this might land in? It's a drop in the ocean of the 3.2k open issues, but would be nice to get this issue closed out :) |
So far as I can tell, this PR has not been merged. I can't see any trace of it in either 7.4 preview 3 or a recent daily build. Are there folks that want to take this on and complete the PR? If not, we should close this. |
@Shriram0908 disappeared right before the finish line, it seems. 😕 |
@doctordns I've created a new PR which should address this. Will wait for feedback and hopefully get this one merged since I needed this recently and would be great to have these cmdlets in 7.4. |
The
Export-CliXml
command should offer a parameter set that emits a string, instead of writing the result to a file. Right now, it only supports outputting CLIXML to a file via the-Path
or-LiteralPath
parameters.Cheers,
Trevor Sullivan
The text was updated successfully, but these errors were encountered: