//
// Copyright (C) Microsoft. All rights reserved.
//
using Microsoft.PowerShell.Activities;
using System.Management.Automation;
using System.Activities;
using System.Collections.Generic;
using System.ComponentModel;
namespace Microsoft.PowerShell.Core.Activities
{
///
/// Activity to invoke the Microsoft.PowerShell.Core\Where-Object command in a Workflow.
///
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
public sealed class WhereObject : PSActivity
{
///
/// Gets the display name of the command invoked by this activity.
///
public WhereObject()
{
this.DisplayName = "Where-Object";
}
///
/// Gets the fully qualified name of the command invoked by this activity.
///
public override string PSCommandName { get { return "Microsoft.PowerShell.Core\\Where-Object"; } }
// Arguments
///
/// Provides access to the InputObject parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument InputObject { get; set; }
///
/// Provides access to the FilterScript parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument FilterScript { get; set; }
///
/// Provides access to the Property parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument Property { get; set; }
///
/// Provides access to the Value parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument Value { get; set; }
///
/// Provides access to the EQ parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument EQ { get; set; }
///
/// Provides access to the CEQ parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CEQ { get; set; }
///
/// Provides access to the NE parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument NE { get; set; }
///
/// Provides access to the CNE parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CNE { get; set; }
///
/// Provides access to the GT parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument GT { get; set; }
///
/// Provides access to the CGT parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CGT { get; set; }
///
/// Provides access to the LT parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument LT { get; set; }
///
/// Provides access to the CLT parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CLT { get; set; }
///
/// Provides access to the GE parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument GE { get; set; }
///
/// Provides access to the CGE parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CGE { get; set; }
///
/// Provides access to the LE parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument LE { get; set; }
///
/// Provides access to the CLE parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CLE { get; set; }
///
/// Provides access to the Like parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument Like { get; set; }
///
/// Provides access to the CLike parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CLike { get; set; }
///
/// Provides access to the NotLike parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument NotLike { get; set; }
///
/// Provides access to the CNotLike parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CNotLike { get; set; }
///
/// Provides access to the Match parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument Match { get; set; }
///
/// Provides access to the CMatch parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CMatch { get; set; }
///
/// Provides access to the NotMatch parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument NotMatch { get; set; }
///
/// Provides access to the CNotMatch parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CNotMatch { get; set; }
///
/// Provides access to the Contains parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument Contains { get; set; }
///
/// Provides access to the CContains parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CContains { get; set; }
///
/// Provides access to the NotContains parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument NotContains { get; set; }
///
/// Provides access to the CNotContains parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CNotContains { get; set; }
///
/// Provides access to the In parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument In { get; set; }
///
/// Provides access to the CIn parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CIn { get; set; }
///
/// Provides access to the NotIn parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument NotIn { get; set; }
///
/// Provides access to the CNotIn parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument CNotIn { get; set; }
///
/// Provides access to the Is parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument Is { get; set; }
///
/// Provides access to the IsNot parameter.
///
[ParameterSpecificCategory]
[DefaultValue(null)]
public InArgument IsNot { get; set; }
// Module defining this command
// Optional custom code for this activity
///
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
///
/// The NativeActivityContext for the currently running activity.
/// A populated instance of Sytem.Management.Automation.PowerShell
/// The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.
protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
{
System.Management.Automation.PowerShell invoker = global::System.Management.Automation.PowerShell.Create();
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
// Initialize the arguments
if(InputObject.Expression != null)
{
targetCommand.AddParameter("InputObject", InputObject.Get(context));
}
if(FilterScript.Expression != null)
{
targetCommand.AddParameter("FilterScript", FilterScript.Get(context));
}
if(Property.Expression != null)
{
targetCommand.AddParameter("Property", Property.Get(context));
}
if(Value.Expression != null)
{
targetCommand.AddParameter("Value", Value.Get(context));
}
if(EQ.Expression != null)
{
targetCommand.AddParameter("EQ", EQ.Get(context));
}
if(CEQ.Expression != null)
{
targetCommand.AddParameter("CEQ", CEQ.Get(context));
}
if(NE.Expression != null)
{
targetCommand.AddParameter("NE", NE.Get(context));
}
if(CNE.Expression != null)
{
targetCommand.AddParameter("CNE", CNE.Get(context));
}
if(GT.Expression != null)
{
targetCommand.AddParameter("GT", GT.Get(context));
}
if(CGT.Expression != null)
{
targetCommand.AddParameter("CGT", CGT.Get(context));
}
if(LT.Expression != null)
{
targetCommand.AddParameter("LT", LT.Get(context));
}
if(CLT.Expression != null)
{
targetCommand.AddParameter("CLT", CLT.Get(context));
}
if(GE.Expression != null)
{
targetCommand.AddParameter("GE", GE.Get(context));
}
if(CGE.Expression != null)
{
targetCommand.AddParameter("CGE", CGE.Get(context));
}
if(LE.Expression != null)
{
targetCommand.AddParameter("LE", LE.Get(context));
}
if(CLE.Expression != null)
{
targetCommand.AddParameter("CLE", CLE.Get(context));
}
if(Like.Expression != null)
{
targetCommand.AddParameter("Like", Like.Get(context));
}
if(CLike.Expression != null)
{
targetCommand.AddParameter("CLike", CLike.Get(context));
}
if(NotLike.Expression != null)
{
targetCommand.AddParameter("NotLike", NotLike.Get(context));
}
if(CNotLike.Expression != null)
{
targetCommand.AddParameter("CNotLike", CNotLike.Get(context));
}
if(Match.Expression != null)
{
targetCommand.AddParameter("Match", Match.Get(context));
}
if(CMatch.Expression != null)
{
targetCommand.AddParameter("CMatch", CMatch.Get(context));
}
if(NotMatch.Expression != null)
{
targetCommand.AddParameter("NotMatch", NotMatch.Get(context));
}
if(CNotMatch.Expression != null)
{
targetCommand.AddParameter("CNotMatch", CNotMatch.Get(context));
}
if(Contains.Expression != null)
{
targetCommand.AddParameter("Contains", Contains.Get(context));
}
if(CContains.Expression != null)
{
targetCommand.AddParameter("CContains", CContains.Get(context));
}
if(NotContains.Expression != null)
{
targetCommand.AddParameter("NotContains", NotContains.Get(context));
}
if(CNotContains.Expression != null)
{
targetCommand.AddParameter("CNotContains", CNotContains.Get(context));
}
if(In.Expression != null)
{
targetCommand.AddParameter("In", In.Get(context));
}
if(CIn.Expression != null)
{
targetCommand.AddParameter("CIn", CIn.Get(context));
}
if(NotIn.Expression != null)
{
targetCommand.AddParameter("NotIn", NotIn.Get(context));
}
if(CNotIn.Expression != null)
{
targetCommand.AddParameter("CNotIn", CNotIn.Get(context));
}
if(Is.Expression != null)
{
targetCommand.AddParameter("Is", Is.Get(context));
}
if(IsNot.Expression != null)
{
targetCommand.AddParameter("IsNot", IsNot.Get(context));
}
return new ActivityImplementationContext() { PowerShellInstance = invoker };
}
}
}