public override void Execute(string[] args)
        {
            Info(String.Format(CultureInfo.CurrentCulture, Resources.Notify_InstallingPerformanceCounters));

            var            installer = new PerformanceCounterInstaller();
            IList <string> counters;

            try
            {
                counters = installer.InstallCounters();
            }
            catch (UnauthorizedAccessException ex)
            {
                // Probably due to not running as admin, let's just stop here
                Warning(String.Format(CultureInfo.CurrentCulture, ex.Message + Resources.Notify_TryRunningAsAdmin));
                return;
            }

            foreach (var counter in counters)
            {
                Info("  " + counter);
            }

            Success(String.Format(CultureInfo.CurrentCulture, Resources.Notify_PerformanceCountersInstalled));
        }
        public override void Execute(string[] args)
        {
            var installer = new PerformanceCounterInstaller();
            installer.UninstallCounters();

            Success(String.Format(CultureInfo.CurrentCulture, Resources.Notify_PerformanceCountersUninstalled));
        }
        public override void Execute(string[] args)
        {
            Info(String.Format(CultureInfo.CurrentCulture, Resources.Notify_InstallingPerformanceCounters));

            var installer = new PerformanceCounterInstaller();
            IList<string> counters;

            try
            {
                counters = installer.InstallCounters();
            }
            catch (UnauthorizedAccessException ex)
            {
                // Probably due to not running as admin, let's just stop here
                Warning(String.Format(CultureInfo.CurrentCulture, ex.Message + Resources.Notify_TryRunningAsAdmin));
                return;
            }

            foreach (var counter in counters)
            {
                Info("  " + counter);
            }

            Success(String.Format(CultureInfo.CurrentCulture, Resources.Notify_PerformanceCountersInstalled));
        }
        public override void Execute(string[] args)
        {
            var installer = new PerformanceCounterInstaller();
            installer.UninstallCounters();

            Success("Performance counters uninstalled!");
        }
        public override void Execute(string[] args)
        {
            Info("Installing performance counters...");

            var            installer = new PerformanceCounterInstaller();
            IList <string> counters;

            try
            {
                counters = installer.InstallCounters();
            }
            catch (UnauthorizedAccessException ex)
            {
                // Probably due to not running as admin, let's just stop here
                Warning(ex.Message + " Try running as admin.");
                return;
            }

            foreach (var counter in counters)
            {
                Info("  " + counter);
            }

            Success("Performance counters installed!");
        }
Example #6
0
        public override int Execute(string[] args)
        {
            Info(String.Format(CultureInfo.CurrentCulture, Resources.Notify_InstallingPerformanceCounters));

            var            installer = new PerformanceCounterInstaller();
            IList <string> counters;

            try
            {
                counters = installer.InstallCounters();
            }
            catch (UnauthorizedAccessException ex)
            {
                // Probably due to not running as admin, let's just stop here
                Warning(String.Format(CultureInfo.CurrentCulture, ex.Message + Resources.Notify_TryRunningAsAdmin));

                // NOTE: We return '0' here because we did so in previous versions of this command and it would be
                // a breaking change to do otherwise in a minor release.
                return(0);
            }

            foreach (var counter in counters)
            {
                Info("  " + counter);
            }

            Success(String.Format(CultureInfo.CurrentCulture, Resources.Notify_PerformanceCountersInstalled));
            return(0);
        }
Example #7
0
        public override void Execute(string[] args)
        {
            var installer = new PerformanceCounterInstaller();

            installer.UninstallCounters();

            Success(String.Format(CultureInfo.CurrentCulture, Resources.Notify_PerformanceCountersUninstalled));
        }
        public override void Execute(string[] args)
        {
            var installer = new PerformanceCounterInstaller();

            installer.UninstallCounters();

            Success("Performance counters uninstalled!");
        }