// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. namespace System.Management.Automation { /// /// Provides information about a configuration that is stored in session state. /// public class ConfigurationInfo : FunctionInfo { #region ctor /// /// Creates an instance of the ConfigurationInfo class with the specified name and ScriptBlock. /// /// /// The name of the configuration. /// /// /// The ScriptBlock for the configuration /// /// /// The ExecutionContext for the configuration. /// /// /// If is null. /// internal ConfigurationInfo(string name, ScriptBlock configuration, ExecutionContext context) : this(name, configuration, context, null) { } /// /// Creates an instance of the ConfigurationInfo class with the specified name and ScriptBlock. /// /// /// The name of the configuration. /// /// /// The ScriptBlock for the configuration /// /// /// The ExecutionContext for the configuration. /// /// /// The help file for the configuration. /// /// /// If is null. /// internal ConfigurationInfo(string name, ScriptBlock configuration, ExecutionContext context, string helpFile) : base(name, configuration, context, helpFile) { SetCommandType(CommandTypes.Configuration); } /// /// Creates an instance of the ConfigurationInfo class with the specified name and ScriptBlock. /// /// /// The name of the configuration. /// /// /// The ScriptBlock for the configuration /// /// /// The options to set on the function. Note, Constant can only be set at creation time. /// /// /// The execution context for the configuration. /// /// /// If is null. /// internal ConfigurationInfo(string name, ScriptBlock configuration, ScopedItemOptions options, ExecutionContext context) : this(name, configuration, options, context, null) { } /// /// Creates an instance of the ConfigurationInfo class with the specified name and ScriptBlock. /// /// /// The name of the configuration. /// /// /// The ScriptBlock for the configuration /// /// /// The options to set on the function. Note, Constant can only be set at creation time. /// /// /// The execution context for the configuration. /// /// /// The help file for the configuration. /// /// The configuration is a meta configuration. /// /// If is null. /// internal ConfigurationInfo(string name, ScriptBlock configuration, ScopedItemOptions options, ExecutionContext context, string helpFile, bool isMetaConfig) : base(name, configuration, options, context, helpFile) { SetCommandType(CommandTypes.Configuration); IsMetaConfiguration = isMetaConfig; } /// /// Creates an instance of the ConfigurationInfo class with the specified name and ScriptBlock. /// /// /// The name of the configuration. /// /// /// The ScriptBlock for the configuration /// /// /// The options to set on the function. Note, Constant can only be set at creation time. /// /// /// The execution context for the configuration. /// /// /// The help file for the configuration. /// /// /// If is null. /// internal ConfigurationInfo(string name, ScriptBlock configuration, ScopedItemOptions options, ExecutionContext context, string helpFile) : this(name, configuration, options, context, helpFile, false) { } /// /// This is a copy constructor, used primarily for get-command. /// internal ConfigurationInfo(ConfigurationInfo other) : base(other) { } /// /// This is a copy constructor, used primarily for get-command. /// internal ConfigurationInfo(string name, ConfigurationInfo other) : base(name, other) { } /// /// Create a copy of commandInfo for GetCommandCommand so that we can generate parameter /// sets based on an argument list (so we can get the dynamic parameters.) /// internal override CommandInfo CreateGetCommandCopy(object[] arguments) { var copy = new ConfigurationInfo(this) { IsGetCommandCopy = true, Arguments = arguments }; return copy; } #endregion ctor internal override HelpCategory HelpCategory { get { return HelpCategory.Configuration; } } /// /// Indication whether the configuration is a meta-configuration. /// public bool IsMetaConfiguration { get; internal set; } } }