public static Stream TransformToStream(object inputData)
        {
            switch (inputData)
            {
            case PSObject psObject when psObject.BaseObject != null:
                return(TransformToStream(psObject.BaseObject));

            case Stream streamValue:
                return(streamValue);

            case FileInfo fileInfoValue:
                return(new FileStream(fileInfoValue.FullName, FileMode.Open, FileAccess.Read));

            case null:
                throw new ArgumentNullException();

            default:
                var byteArrayValue = MemoryStreamParameterConverterAttribute.TransformToByteArray(inputData);
                if (byteArrayValue == null)
                {
                    throw new ArgumentException($"Cannot conver type {inputData.GetType().FullName} to System.IO.Stream.");
                }
                return(new MemoryStream(byteArrayValue));
            }
        }
        public override object Transform(EngineIntrinsics engineIntrinsics, object inputData)
        {
            var bytes = MemoryStreamParameterConverterAttribute.TransformToByteArray(inputData);

            if (bytes is byte[] byteArrayValue)
            {
                return(Encoding.UTF8.GetBytes(Utils.Common.ConvertToBase64(byteArrayValue)));
            }
            throw new ArgumentException($"Cannot perform Base64 conversion for type {inputData.GetType().FullName}");
        }