Skip to content

Parse PSResourceInfo #824

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

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/code/PSResourceInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,6 @@ public static bool TryConvertFromXml(

try
{
//XmlNodeList elemList = doc.GetElementsByTagName("m:properties");

var xNodeReader = new XmlNodeReader(entry);
var xmlSerializer = new XmlSerializer(typeof(PSResourceInfo2));
psGetInfo = xmlSerializer.Deserialize(xNodeReader) as PSResourceInfo2;
Expand Down Expand Up @@ -993,10 +991,13 @@ private PSObject ConvertToCustomObject()
// TODO: tmp class for testing/debugging
#region PSResourceInfo2

[Serializable]
[XmlRoot(ElementName = "properties", Namespace = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata")]
public sealed class PSResourceInfo2
{
#region Properties


public string Author { get; set;}
public string Copyright { get; set; }
public string Description { get; set;}
Expand All @@ -1006,6 +1007,8 @@ public sealed class PSResourceInfo2
public string InstalledLocation { get; set; }
public bool IsPrerelease { get; set;}
public string LicenseUri { get; set;}

[XmlElement("Id", Namespace = "http://schemas.microsoft.com/ado/2007/08/dataservices")]
public string Name { get; set;}
public string PackageManagementProvider { get; set;}
public string PowerShellGetFormatVersion { get; set;}
Expand Down