/// <summary>
        /// Parse a json package entry from search into a PowerShellSearchPackage
        /// </summary>
        private static PowerShellSearchPackage Parse(JObject json)
        {
            ServerPackageMetadata basePackage = PackageMetadataParser.ParseMetadata(json);

            PSPackageMetadata psMetadata = new PSPackageMetadata(basePackage.Id, basePackage.Version)
            {
                ModuleVersion = GetVersionOrNull(json, "ModuleVersion"),
                CLRVersion = GetVersionOrNull(json, "CLRVersion"),
                CmdletsToExport = GetStringArray(json, "CmdletsToExport"),
                CompanyName = GetStringOrNull(json, "CompanyName"),
                DotNetFrameworkVersion = GetVersionOrNull(json, "DotNetFrameworkVersion"),
                DscResourcesToExport = GetStringArray(json, "DscResourcesToExport"),
                FunctionsToExport = GetStringArray(json, "FunctionsToExport"),
                Guid = GetGuidOrEmpty(json, "GUID"),
                LicenseUrl = GetUriOrNull(json, "licenseUrl"),
                PowerShellHostVersion = GetVersionOrNull(json, "PowerShellHostVersion"),
                ProcessorArchitecture = GetStringOrNull(json, "ProcessorArchitecture"),
                ProjectUrl = GetUriOrNull(json, "projectUrl"),
                ReleaseNotes = GetStringOrNull(json, "releaseNotes")
            };

            return new PowerShellSearchPackage(basePackage, psMetadata);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Parse a json package entry from search into a PowerShellSearchPackage
        /// </summary>
        private static PowerShellSearchPackage Parse(JObject json)
        {
            var basePackage = PackageMetadataParser.ParseMetadata(json);

            var psMetadata = new PSPackageMetadata(basePackage.Id, basePackage.Version)
            {
                ModuleVersion          = GetVersionOrNull(json, "ModuleVersion"),
                CLRVersion             = GetVersionOrNull(json, "CLRVersion"),
                CmdletsToExport        = GetStringArray(json, "CmdletsToExport"),
                CompanyName            = GetStringOrNull(json, "CompanyName"),
                DotNetFrameworkVersion = GetVersionOrNull(json, "DotNetFrameworkVersion"),
                DscResourcesToExport   = GetStringArray(json, "DscResourcesToExport"),
                FunctionsToExport      = GetStringArray(json, "FunctionsToExport"),
                Guid                  = GetGuidOrEmpty(json, "GUID"),
                LicenseUrl            = GetUriOrNull(json, "licenseUrl"),
                PowerShellHostVersion = GetVersionOrNull(json, "PowerShellHostVersion"),
                ProcessorArchitecture = GetStringOrNull(json, "ProcessorArchitecture"),
                ProjectUrl            = GetUriOrNull(json, "projectUrl"),
                ReleaseNotes          = GetStringOrNull(json, "releaseNotes")
            };

            return(new PowerShellSearchPackage(basePackage, psMetadata));
        }
Exemplo n.º 3
0
 public PowerShellSearchPackage(ServerPackageMetadata serverPackage, PSPackageMetadata powershellMetadata)
     : base(serverPackage.Id, serverPackage.Version)
 {
     _serverPackage      = serverPackage;
     _powershellMetadata = powershellMetadata;
 }
Exemplo n.º 4
0
 public PowerShellSearchPackage(ServerPackageMetadata serverPackage, PSPackageMetadata powershellMetadata)
     : base(serverPackage.Id, serverPackage.Version)
 {
     _serverPackage = serverPackage;
     _powershellMetadata = powershellMetadata;
 }