|
| 1 | +// ---------------------------------------------------------------------------------- |
| 2 | +// |
| 3 | +// Copyright Microsoft Corporation |
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// you may not use this file except in compliance with the License. |
| 6 | +// You may obtain a copy of the License at |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// Unless required by applicable law or agreed to in writing, software |
| 9 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +// See the License for the specific language governing permissions and |
| 12 | +// limitations under the License. |
| 13 | +// ---------------------------------------------------------------------------------- |
| 14 | + |
| 15 | +using System; |
| 16 | +using System.Collections.Generic; |
| 17 | +using System.ComponentModel; |
| 18 | +using System.Reflection; |
| 19 | + |
| 20 | +namespace NetCorePsd1Sync.Model |
| 21 | +{ |
| 22 | + public class PsDefinition |
| 23 | + { |
| 24 | + public PsDefinitionHeader ManifestHeader { get; set; } = new PsDefinitionHeader(); |
| 25 | + |
| 26 | + [DisplayName("RootModule")] |
| 27 | + [Description("Script module or binary module file associated with this manifest.")] |
| 28 | + public string RootModule { get; set; } |
| 29 | + |
| 30 | + [DisplayName("ModuleVersion")] |
| 31 | + [Description("Version number of this module.")] |
| 32 | + public Version ModuleVersion { get; set; } = new Version(1, 0); |
| 33 | + |
| 34 | + [DisplayName("CompatiblePSEditions")] |
| 35 | + [Description("Supported PSEditions")] |
| 36 | + public List<string> CompatiblePsEditions { get; set; } |
| 37 | + |
| 38 | + [DisplayName("GUID")] |
| 39 | + [Description("ID used to uniquely identify this module")] |
| 40 | + public Guid Guid { get; set; } = Guid.NewGuid(); |
| 41 | + |
| 42 | + [DisplayName("Author")] |
| 43 | + [Description("Author of this module")] |
| 44 | + public string Author { get; set; } = Environment.UserName; |
| 45 | + |
| 46 | + [DisplayName("CompanyName")] |
| 47 | + [Description("Company or vendor of this module")] |
| 48 | + public string CompanyName { get; set; } = "Unknown"; |
| 49 | + |
| 50 | + [DisplayName("Copyright")] |
| 51 | + [Description("Copyright statement for this module")] |
| 52 | + public string Copyright { get; set; } = $"(c) {DateTime.Now.Year} {Environment.UserName}. All rights reserved."; |
| 53 | + |
| 54 | + [DisplayName("Description")] |
| 55 | + [Description("Description of the functionality provided by this module")] |
| 56 | + public string Description { get; set; } |
| 57 | + |
| 58 | + [DisplayName("PowerShellVersion")] |
| 59 | + [Description("Minimum version of the Windows PowerShell engine required by this module")] |
| 60 | + public Version PowerShellVersion { get; set; } |
| 61 | + |
| 62 | + [DisplayName("PowerShellHostName")] |
| 63 | + [Description("Name of the Windows PowerShell host required by this module")] |
| 64 | + public string PowerShellHostName { get; set; } |
| 65 | + |
| 66 | + [DisplayName("PowerShellHostVersion")] |
| 67 | + [Description("Minimum version of the Windows PowerShell host required by this module")] |
| 68 | + public Version PowerShellHostVersion { get; set; } |
| 69 | + |
| 70 | + [DisplayName("DotNetFrameworkVersion")] |
| 71 | + [Description("Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.")] |
| 72 | + public Version DotNetFrameworkVersion { get; set; } |
| 73 | + |
| 74 | + [DisplayName("CLRVersion")] |
| 75 | + [Description("Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.")] |
| 76 | + public Version ClrVersion { get; set; } |
| 77 | + |
| 78 | + [DisplayName("ProcessorArchitecture")] |
| 79 | + [Description("Processor architecture (None, X86, Amd64) required by this module")] |
| 80 | + public ProcessorArchitecture? ProcessorArchitecture { get; set; } |
| 81 | + |
| 82 | + [DisplayName("RequiredModules")] |
| 83 | + [Description("Modules that must be imported into the global environment prior to importing this module")] |
| 84 | + public List<ModuleReference> RequiredModules { get; set; } |
| 85 | + |
| 86 | + [DisplayName("RequiredAssemblies")] |
| 87 | + [Description("Assemblies that must be loaded prior to importing this module")] |
| 88 | + public List<string> RequiredAssemblies { get; set; } |
| 89 | + |
| 90 | + [DisplayName("ScriptsToProcess")] |
| 91 | + [Description("Script files (.ps1) that are run in the caller's environment prior to importing this module.")] |
| 92 | + public List<string> ScriptsToProcess { get; set; } |
| 93 | + |
| 94 | + [DisplayName("TypesToProcess")] |
| 95 | + [Description("Type files (.ps1xml) to be loaded when importing this module")] |
| 96 | + public List<string> TypesToProcess { get; set; } |
| 97 | + |
| 98 | + [DisplayName("FormatsToProcess")] |
| 99 | + [Description("Format files (.ps1xml) to be loaded when importing this module")] |
| 100 | + public List<string> FormatsToProcess { get; set; } |
| 101 | + |
| 102 | + [DisplayName("NestedModules")] |
| 103 | + [Description("Modules to import as nested modules of the module specified in RootModule/ModuleToProcess")] |
| 104 | + public List<ModuleReference> NestedModules { get; set; } |
| 105 | + |
| 106 | + [DisplayName("FunctionsToExport")] |
| 107 | + [Description("Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.")] |
| 108 | + public List<string> FunctionsToExport { get; set; } = new List<string>(); |
| 109 | + |
| 110 | + [DisplayName("CmdletsToExport")] |
| 111 | + [Description("Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.")] |
| 112 | + public List<string> CmdletsToExport { get; set; } = new List<string>(); |
| 113 | + |
| 114 | + [DisplayName("VariablesToExport")] |
| 115 | + [Description("Variables to export from this module")] |
| 116 | + public List<string> VariablesToExport { get; set; } = new List<string> { "*" }; |
| 117 | + |
| 118 | + [DisplayName("AliasesToExport")] |
| 119 | + [Description("Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.")] |
| 120 | + public List<string> AliasesToExport { get; set; } = new List<string>(); |
| 121 | + |
| 122 | + [DisplayName("DscResourcesToExport")] |
| 123 | + [Description("DSC resources to export from this module")] |
| 124 | + public List<string> DscResourcesToExport { get; set; } |
| 125 | + |
| 126 | + [DisplayName("ModuleList")] |
| 127 | + [Description("List of all modules packaged with this module")] |
| 128 | + public List<ModuleReference> ModuleList { get; set; } |
| 129 | + |
| 130 | + [DisplayName("FileList")] |
| 131 | + [Description("List of all files packaged with this module")] |
| 132 | + public List<string> FileList { get; set; } |
| 133 | + |
| 134 | + [DisplayName("PrivateData")] |
| 135 | + [Description("Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.")] |
| 136 | + public PrivateData PrivateData { get; set; } = new PrivateData(); |
| 137 | + |
| 138 | + [DisplayName("HelpInfoURI")] |
| 139 | + [Description("HelpInfo URI of this module")] |
| 140 | + public string HelpInfoUri { get; set; } |
| 141 | + |
| 142 | + [DisplayName("DefaultCommandPrefix")] |
| 143 | + [Description("Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.")] |
| 144 | + public string DefaultCommandPrefix { get; set; } |
| 145 | + } |
| 146 | +} |
0 commit comments