Exemple #1
0
        /// <summary>
        /// Cmdlet begin process. Write to logs, setup Http Tracing and initialize profile
        /// </summary>
        protected override void BeginProcessing()
        {
            FlushInitializationWarnings();
            SessionState = base.SessionState;
            var profile = _dataCollectionProfile;

            //TODO: Inject from CI server
            lock (lockObject)
            {
                if (_metricHelper == null)
                {
                    _metricHelper = new MetricHelper(profile);
                    _metricHelper.AddTelemetryClient(new TelemetryClient
                    {
                        InstrumentationKey = "7df6ff70-8353-4672-80d6-568517fed090"
                    });
                }
            }

            InitializeQosEvent();
            LogCmdletStartInvocationInfo();
            InitDebuggingFilter();
            SetupDebuggingTraces();
            SetupHttpClientPipeline();
            base.BeginProcessing();

            //Now see if the cmdlet has any Breaking change attributes on it and process them if it does
            //This will print any breaking change attribute messages that are applied to the cmdlet
            BreakingChangeAttributeHelper.ProcessCustomAttributesAtRuntime(this.GetType(), this.MyInvocation, WriteWarning);
            PreviewAttributeHelper.ProcessCustomAttributesAtRuntime(this.GetType(), this.MyInvocation, WriteDebug);
        }
        /// <summary>
        /// Initializes AzurePSCmdlet properties.
        /// </summary>
        public AzurePSCmdlet()
        {
            DebugMessages = new ConcurrentQueue <string>();

            //TODO: Inject from CI server
            _metricHelper = new MetricHelper();
            _metricHelper.AddTelemetryClient(new TelemetryClient
            {
                InstrumentationKey = "7df6ff70-8353-4672-80d6-568517fed090"
            });
        }
Exemple #3
0
        private static MetricHelper CreateMetricHelper(AzurePSDataCollectionProfile profile)
        {
            var result = new MetricHelper(profile);

            result.AddTelemetryClient(new TelemetryClient
            {
                InstrumentationKey = "7df6ff70-8353-4672-80d6-568517fed090"
            });

            return(result);
        }
        /// <summary>
        /// Cmdlet begin process. Write to logs, setup Http Tracing and initialize profile
        /// </summary>
        protected override void BeginProcessing()
        {
            var profile = _dataCollectionProfile;

            //TODO: Inject from CI server
            lock (lockObject)
            {
                if (_metricHelper == null)
                {
                    _metricHelper = new MetricHelper(profile);
                    _metricHelper.AddTelemetryClient(new TelemetryClient
                    {
                        InstrumentationKey = "7df6ff70-8353-4672-80d6-568517fed090"
                    });
                }
            }

            InitializeQosEvent();
            LogCmdletStartInvocationInfo();
            SetupDebuggingTraces();
            SetupHttpClientPipeline();
            base.BeginProcessing();
        }