Git Product home page Git Product logo

convert's People

Contributors

austoonz avatar techthoughts2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

convert's Issues

ConvertFrom-Clixml should support conversions from files holding multiple Clixml objects

Expected Behavior

When running ConvertFrom-Clixml with a file that contains multiple Clixml objects - the conversion should be able to convert all objects via the pipeline.

$galleryXMLData = Get-Content -Path "C:\xml\all.xml" -Raw
$converted = $galleryXMLData | ConvertFrom-Clixml

Current Behavior

Currently - regardless if -Raw is used or not ConvertFrom-Clixml is only able to convert a file if it contains a singular Clixml object.

Possible Solution

Here is how I am currently working around this:

$galleryData = @()
$galleryXMLData = Get-Content -Path "C:\xml\all.xml" -Raw
$splitup = $galleryXMLData -split '(?<!^)(?=<Objs Version="1.1.0.1" xmlns="http:\/\/schemas.microsoft.com\/powershell\/2004\/04">)'
foreach ($item in $splitup) {
    $galleryData += $item | ConvertFrom-Clixml
}

Steps to Reproduce

  1. Download the Sample XML you can use for testing
  2. Import the file data using Get-Content
  3. Attempt to convert the contents of the data back into PS Object format

Context (Environment)

I have a Clixml file that contains many converted objects. I am attempting to get the contents of the file and convert them back to PowerShell object format. This is working when the file contains one Clixml entry, but not when it contains multiple.

I do currently have a work-around for this which I have shown above.

  • Operating System and version as reported by $PSVersionTable.OS: Microsoft Windows 10.0.18362
  • PowerShell versions as reported by $PSVersionTable.PSEdition: Core

Detailed Description

Based on the behavior it seems like Get-Content doesn't have a delimter available for Clixml data to properly parse it. Because of the lack of delimter the ConvertFrom-Clixml doesn't have a way to handle multiple objects.

This could be handled by introducing a delimeter of some kind when ConvertTo-Clixml is used. Alternatively, logic could be added to permit ConvertFrom-Clixml to handle multi-object conversions.

Unable to install

Hello,

Invalid endpoint: https://s3..amazonaws.com
  - Failed to download InvokeBuild
Failed to download InvokeBuild
At C:\Users\user\git\Convert\install_modules.ps1:104 char:9
+         throw $message
+         ~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Failed to download InvokeBuild:String) [], RuntimeException
    + FullyQualifiedErrorId : Failed to download InvokeBuild

Is your S3-bucket and/or this bucket still alive? :)

Oh and also the links here;
https://convert.readthedocs.io/en/latest/
gives 404:s.

Best Regards - CloudViking86

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.