GithubHelp home page GithubHelp logo

pwshreadxmlplist's Introduction

** Work In Progress **

  • ๐Ÿ‘‹ Hi, Iโ€™m @msftrncs (or Carl Morris)
  • ๐Ÿ‘€ Iโ€™m interested in ...
    • PowerShell
    • Regular Expressions
    • IEC 61131-3
    • TextMate Grammars
    • Databases
  • ๐ŸŒฑ Iโ€™m currently learning ...
    • Old tricks
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on ...
  • ๐Ÿ“ซ How to reach me ...

pwshreadxmlplist's People

Contributors

msftrncs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

golubenkoff

pwshreadxmlplist's Issues

The output is incorrect

Use the following code to see the value of a key. The output is incorrect

Sample file:
test.zip

$pList = [xml](get-content "C:\Users\Administrator\Desktop\test.plist") | ConvertFrom-Plist
$pList.ACPI.DSDT.Patches.find

out:
80
88
83
88
8
95
65
68
82
0
8
95
80
82
87
18
6
2
71
70
88
48
72
68
69
70
95
68
83
77
72
69
67
73

Empty elements returned without declared data type, causing incorrect behavior in downstream tools

Using the following code, a null label will be output incorrectly,
Sample file
test.zip

before:

                    <key>Base</key>
                    <string></string>

after:

                    		<key>Base</key>
				<dict>
				</dict>

before:

                    <key>ReplaceMask</key>
                    <data></data>

after:

				<key>ReplaceMask</key>
				<dict>
				</dict>

before:

            <key>Patch</key>
            <array/>

after:

		<key>Patch</key>
		<dict>
		</dict>

powershell code:

$pList = [xml](get-content "C:\Users\Administrator\Desktop\s1.plist") | ConvertFrom-Plist

$pList | ConvertTo-Plist -Indent "`t" -StateEncodingAs 'UTF-8' -Depth 6 | Set-Content 'C:\Users\Administrator\Desktop\s1-ok.plist' -Encoding 'UTF8'

Planned Changes

I plan to make changes to the layout and operation of this function, similar to ConvertTo-PList.

  • Rename function to 'ConvertFrom-Plist'
  • Alter output so dictionaries are converted to [ordered] hashtables instead of PSCustomObjects.
  • Redesign and test for performance, using an internal static Class to handle the conversion of the XML to PowerShell object, to improve performance.

See: https://github.com/msftrncs/PwshReadXmlPList/tree/ConvertFrom-Plist

<data> Label processing error

thanks for the powershell tools!

I found a problem in using, < data > label processing error,

For example:


before:

<data>U0FUMA==</data>

after:

<string>83 65 84 48</string>

before:

				<key>Find</key>
				<data>RXh0ZXJuYWw=</data>

after:

				<key>Find</key>
				<array>
					<integer>69</integer>
					<integer>120</integer>
					<integer>116</integer>
					<integer>101</integer>
					<integer>114</integer>
					<integer>110</integer>
					<integer>97</integer>
					<integer>108</integer>
				</array>

My programming level, English expression is not very good,

so, I recorded a video demonstration: https://www12.zippyshare.com/v/CKLQBgMj/file.html

Related documents: https://www12.zippyshare.com/v/4VdpVBR0/file.html

This is a good tool. Thank you in advance

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.