Example #1
0
        private ImmutableDictionary <String, ParameterSet> RemoveCandidateIfParamDefault(
            ImmutableDictionary <String, ParameterSet> candidates,
            Parameter parameter
            )
        {
            if (parameter.IsCommonParameter)
            {
                Logger.Debug(
                    "Skipping common parameter {Parameter}",
                    parameter.Name
                    );

                return(candidates);
            }

            if (parameter.HasDefaultValue(Target))
            {
                Logger.Debug(
                    "Parameter {Parameter} has default value, removing {ParameterSetName} from candidates",
                    parameter.Name,
                    parameter.ParameterSetName
                    );

                return(candidates.Remove(
                           parameter.ParameterSetName
                           ));
            }

            Logger.Debug(
                "Parameter {Parameter} has a value set, keeping {ParameterSetName} as a candidate",
                parameter.Name,
                parameter.ParameterSetName
                );

            return(candidates);
        }
        private ImmutableDictionary<String, ParameterSet> RemoveCandidateIfParamDefault(
            ImmutableDictionary<String, ParameterSet> candidates,
            Parameter parameter
        )
        {
            if (parameter.IsCommonParameter)
            {
                Logger.Debug(
                    "Skipping common parameter {Parameter}",
                    parameter.Name
                );

                return candidates;
            }

            if (parameter.HasDefaultValue(Target))
            {
                Logger.Debug(
                    "Parameter {Parameter} has default value, removing {ParameterSetName} from candidates",
                    parameter.Name,
                    parameter.ParameterSetName
                );

                return candidates.Remove(
                    parameter.ParameterSetName
                );
            }

            Logger.Debug(
                "Parameter {Parameter} has a value set, keeping {ParameterSetName} as a candidate",
                parameter.Name,
                parameter.ParameterSetName
            );

            return candidates;
        }