Repository: PowerShell/PowerShell
File: src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs (C#)

Code before:
        }

        public override string ToString()
        {
            return string.Format(
                CultureInfo.InvariantCulture,
                "{0}> {1}",
                FromStream == RedirectionStream.All
                    ? "*"
                    : ((int)FromStream).ToString(CultureInfo.InvariantCulture),
                File);
        }

        internal string File { get; }

        internal bool Appending { get; }

        private PipelineProcessor PipelineProcessor { get; set; }

        // Handle binding file redirection for commands, like:
        //    dir > out
        internal override void Bind(PipelineProcessor pipelineProcessor, CommandProcessorBase commandProcessor, ExecutionContext context)
        {
            // Check first to see if File is a variable path. If so, we'll not create the FileBytePipe
            bool redirectToVariable = false;
            if (ExperimentalFeature.IsEnabled("PSRedirectToVariable"))
            {
                ProviderInfo p;
                context.SessionState.Path.GetUnresolvedProviderPathFromPSPath(File, out p, out _);
                if (p != null && p.NameEquals(context.ProviderNames.Variable))
                {
                    redirectToVariable = true;
                }
            }

            if (commandProcessor is NativeCommandProcessor nativeCommand
                && nativeCommand.CommandRuntime.ErrorMergeTo is not MshCommandRuntime.MergeDataStream.Output
                && FromStream is RedirectionStream.Output
                && !string.IsNullOrWhiteSpace(File)
                && !redirectToVariable)
            {
                nativeCommand.StdOutDestination = FileBytePipe.Create(File, Appending);
                return;
            }

            Pipe pipe = GetRedirectionPipe(context, pipelineProcessor);

            switch (FromStream)
            {
                case RedirectionStream.All:
                    // Since a temp output pipe is going to be used, we should pass along the error and warning variable list.

Review comment (suggestion):
```suggestion
            if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSRedirectToVariable))
```

Code after:
        }

        public override string ToString()
        {
            return string.Format(
                CultureInfo.InvariantCulture,
                "{0}> {1}",
                FromStream == RedirectionStream.All
                    ? "*"
                    : ((int)FromStream).ToString(CultureInfo.InvariantCulture),
                File);
        }

        internal string File { get; }

        internal bool Appending { get; }

        private PipelineProcessor PipelineProcessor { get; set; }

        // Handle binding file redirection for commands, like:
        //    dir > out
        internal override void Bind(PipelineProcessor pipelineProcessor, CommandProcessorBase commandProcessor, ExecutionContext context)
        {
            // Check first to see if File is a variable path. If so, we'll not create the FileBytePipe
            bool redirectToVariable = false;
            if (ExperimentalFeature.IsEnabled(ExperimentalFeature.PSRedirectToVariable))
            {
                ProviderInfo p;
                context.SessionState.Path.GetUnresolvedProviderPathFromPSPath(File, out p, out _);
                if (p != null && p.NameEquals(context.ProviderNames.Variable))
                {
                    redirectToVariable = true;
                }
            }

            if (commandProcessor is NativeCommandProcessor nativeCommand
                && nativeCommand.CommandRuntime.ErrorMergeTo is not MshCommandRuntime.MergeDataStream.Output
                && FromStream is RedirectionStream.Output
                && !string.IsNullOrWhiteSpace(File)
                && !redirectToVariable)
            {
                nativeCommand.StdOutDestination = FileBytePipe.Create(File, Appending);
                return;
            }

            Pipe pipe = GetRedirectionPipe(context, pipelineProcessor);

            switch (FromStream)
            {
                case RedirectionStream.All:
                    // Since a temp output pipe is going to be used, we should pass along the error and warning variable list.