/// <summary>
        /// Override EndProcessing.
        /// </summary>
        protected override void EndProcessing()
        {
            PSMarkdownOptionInfo mdOptionInfo = null;

            switch (ParameterSetName)
            {
            case ThemeParamSet:
                mdOptionInfo = new PSMarkdownOptionInfo();
                if (string.Equals(Theme, LightThemeName, StringComparison.OrdinalIgnoreCase))
                {
                    mdOptionInfo.SetLightTheme();
                }
                else if (string.Equals(Theme, DarkThemeName, StringComparison.OrdinalIgnoreCase))
                {
                    mdOptionInfo.SetDarkTheme();
                }

                break;

            case InputObjectParamSet:
                object baseObj = InputObject.BaseObject;
                mdOptionInfo = baseObj as PSMarkdownOptionInfo;

                if (mdOptionInfo is null)
                {
                    var errorMessage = StringUtil.Format(ConvertMarkdownStrings.InvalidInputObjectType, baseObj.GetType());

                    ErrorRecord errorRecord = new ErrorRecord(
                        new ArgumentException(errorMessage),
                        "InvalidObject",
                        ErrorCategory.InvalidArgument,
                        InputObject);
                }

                break;

            case IndividualSetting:
                mdOptionInfo = new PSMarkdownOptionInfo();
                SetOptions(mdOptionInfo);
                break;
            }

            var setOption = PSMarkdownOptionInfoCache.Set(this.CommandInfo, mdOptionInfo);

            if (PassThru.IsPresent)
            {
                WriteObject(setOption);
            }
        }
        /// <summary>
        /// Read the PSMarkdownOptionInfo set in SessionState.
        /// </summary>
        protected override void BeginProcessing()
        {
            _mdOption = PSMarkdownOptionInfoCache.Get(this.CommandInfo);

            bool?supportsVT100 = this.Host?.UI.SupportsVirtualTerminal;

            // supportsVT100 == null if the host is null.
            // supportsVT100 == false if host does not support VT100.
            if (supportsVT100 != true)
            {
                _mdOption.EnableVT100Encoding = false;
            }

            if (AsVT100EncodedString)
            {
                _conversionType = MarkdownConversionType.VT100;
            }
        }
 /// <summary>
 /// Override EndProcessing.
 /// </summary>
 protected override void EndProcessing()
 {
     WriteObject(PSMarkdownOptionInfoCache.Get(this.CommandInfo));
 }