Exemplo n.º 1
0
        // Configures IIS features from custom features
        public static void ExecuteFromCustomFeatures()
        {
            Console.WriteLine(string.Empty);
            Console.WriteLine($@"> Configures IIS features from custom features");

            FeatureCommandsCollection commands = Configurator.CreateCommands(Configurator.GetAllFeatures(), CommandOptions.SilentModeDeactivated);

            commands.NotifyFeatureCommandCollectionExecuting += NotifyFeatureCommandCollectionExecuting;
            commands.NotifyFeatureCommandCollectionExecuted  += NotifyFeatureCommandCollectionExecuted;
            commands.NotifyFeatureCommandsCollectionStart    += NotifyFeatureCommandsCollectionStart;
            commands.NotifyFeatureCommandsCollectionFinish   += NotifyFeatureCommandsCollectionFinish;
            commands.Process();
        }
Exemplo n.º 2
0
        // Configures IIS features from XML configuration file
        public static void ExecuteFromXmlFile()
        {
            Console.WriteLine();
            Console.WriteLine($@"> Configures IIS features from XML configuration file");

            IISModel model = IISModel.LoadFromFile("~\\resources\\IIS-Features.xml");
            FeatureCommandsCollection commands = Configurator.CreateCommands(model, CommandOptions.SilentModeDeactivated);

            commands.NotifyFeatureCommandCollectionExecuting += NotifyFeatureCommandCollectionExecuting;
            commands.NotifyFeatureCommandCollectionExecuted  += NotifyFeatureCommandCollectionExecuted;
            commands.NotifyFeatureCommandsCollectionStart    += NotifyFeatureCommandsCollectionStart;
            commands.NotifyFeatureCommandsCollectionFinish   += NotifyFeatureCommandsCollectionFinish;
            commands.Process();
        }