mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Add source files for Microsoft.PowerShell.Security.Activities
This commit is contained in:
1 parent
a521fcf878
commit
4f2eb80963
13 files changed
+1398
No files matched your search
@@ -0,0 +1,18 @@
|
||||
using System.Reflection;
|
||||
using System.Security.Permissions;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
|
||||
[assembly: AssemblyVersion("3.0.0.0")]
|
||||
[assembly: AssemblyFileVersionAttribute("3.0.0.0")]
|
||||
[assembly: System.Runtime.InteropServices.ComVisible(false)]
|
||||
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: ReliabilityContractAttribute(Consistency.MayCorruptAppDomain, Cer.MayFail)]
|
||||
[assembly: AssemblyTitle("Microsoft.PowerShell.Security.Activities")]
|
||||
[assembly: AssemblyDescription("Microsoft.PowerShell.Security.Activities")]
|
||||
|
||||
[module: SuppressMessage("Microsoft.Design", "CA1014:MarkAssembliesWithClsCompliant")]
|
||||
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\ConvertFrom-SecureString command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class ConvertFromSecureString : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public ConvertFromSecureString()
|
||||
{
|
||||
this.DisplayName = "ConvertFrom-SecureString";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\ConvertFrom-SecureString"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the SecureString parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Security.SecureString> SecureString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the SecureKey parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Security.SecureString> SecureKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Key parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Byte[]> Key { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(SecureString.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("SecureString", SecureString.Get(context));
|
||||
}
|
||||
|
||||
if(SecureKey.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("SecureKey", SecureKey.Get(context));
|
||||
}
|
||||
|
||||
if(Key.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Key", Key.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\ConvertTo-SecureString command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class ConvertToSecureString : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public ConvertToSecureString()
|
||||
{
|
||||
this.DisplayName = "ConvertTo-SecureString";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\ConvertTo-SecureString"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the String parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> String { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the AsPlainText parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> AsPlainText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Force parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> Force { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the SecureKey parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Security.SecureString> SecureKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Key parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Byte[]> Key { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(String.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("String", String.Get(context));
|
||||
}
|
||||
|
||||
if(AsPlainText.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("AsPlainText", AsPlainText.Get(context));
|
||||
}
|
||||
|
||||
if(Force.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Force", Force.Get(context));
|
||||
}
|
||||
|
||||
if(SecureKey.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("SecureKey", SecureKey.Get(context));
|
||||
}
|
||||
|
||||
if(Key.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Key", Key.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Get-Acl command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class GetAcl : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public GetAcl()
|
||||
{
|
||||
this.DisplayName = "Get-Acl";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Get-Acl"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Path parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the InputObject parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.PSObject> InputObject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> LiteralPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Audit parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> Audit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the AllCentralAccessPolicies parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> AllCentralAccessPolicies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Filter parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Filter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Include parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> Include { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Exclude parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> Exclude { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(Path.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Path", Path.Get(context));
|
||||
}
|
||||
|
||||
if(InputObject.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("InputObject", InputObject.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
if(Audit.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Audit", Audit.Get(context));
|
||||
}
|
||||
|
||||
if(AllCentralAccessPolicies.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("AllCentralAccessPolicies", AllCentralAccessPolicies.Get(context));
|
||||
}
|
||||
|
||||
if(Filter.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Filter", Filter.Get(context));
|
||||
}
|
||||
|
||||
if(Include.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Include", Include.Get(context));
|
||||
}
|
||||
|
||||
if(Exclude.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Exclude", Exclude.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Get-AuthenticodeSignature command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class GetAuthenticodeSignature : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public GetAuthenticodeSignature()
|
||||
{
|
||||
this.DisplayName = "Get-AuthenticodeSignature";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Get-AuthenticodeSignature"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the FilePath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> FilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> LiteralPath { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(FilePath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("FilePath", FilePath.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Get-CmsMessage command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class GetCmsMessage : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public GetCmsMessage()
|
||||
{
|
||||
this.DisplayName = "Get-CmsMessage";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Get-CmsMessage"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Content parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Path parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> LiteralPath { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(Content.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Content", Content.Get(context));
|
||||
}
|
||||
|
||||
if(Path.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Path", Path.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Get-ExecutionPolicy command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class GetExecutionPolicy : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public GetExecutionPolicy()
|
||||
{
|
||||
this.DisplayName = "Get-ExecutionPolicy";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Get-ExecutionPolicy"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Scope parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<Microsoft.PowerShell.ExecutionPolicyScope> Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the List parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> List { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(Scope.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Scope", Scope.Get(context));
|
||||
}
|
||||
|
||||
if(List.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("List", List.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Get-PfxCertificate command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class GetPfxCertificate : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public GetPfxCertificate()
|
||||
{
|
||||
this.DisplayName = "Get-PfxCertificate";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Get-PfxCertificate"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the FilePath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> FilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> LiteralPath { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(FilePath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("FilePath", FilePath.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Protect-CmsMessage command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class ProtectCmsMessage : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public ProtectCmsMessage()
|
||||
{
|
||||
this.DisplayName = "Protect-CmsMessage";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Protect-CmsMessage"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the To parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.CmsMessageRecipient[]> To { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Content parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.PSObject> Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Path parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> LiteralPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the OutFile parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> OutFile { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(To.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("To", To.Get(context));
|
||||
}
|
||||
|
||||
if(Content.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Content", Content.Get(context));
|
||||
}
|
||||
|
||||
if(Path.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Path", Path.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
if(OutFile.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("OutFile", OutFile.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Set-Acl command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class SetAcl : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public SetAcl()
|
||||
{
|
||||
this.DisplayName = "Set-Acl";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Set-Acl"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Path parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the InputObject parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.PSObject> InputObject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> LiteralPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the AclObject parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Object> AclObject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the SecurityDescriptor parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Security.AccessControl.CommonSecurityDescriptor> SecurityDescriptor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the CentralAccessPolicy parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> CentralAccessPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the ClearCentralAccessPolicy parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> ClearCentralAccessPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Passthru parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> Passthru { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Filter parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Filter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Include parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> Include { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Exclude parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> Exclude { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(Path.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Path", Path.Get(context));
|
||||
}
|
||||
|
||||
if(InputObject.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("InputObject", InputObject.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
if(AclObject.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("AclObject", AclObject.Get(context));
|
||||
}
|
||||
|
||||
if(SecurityDescriptor.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("SecurityDescriptor", SecurityDescriptor.Get(context));
|
||||
}
|
||||
|
||||
if(CentralAccessPolicy.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("CentralAccessPolicy", CentralAccessPolicy.Get(context));
|
||||
}
|
||||
|
||||
if(ClearCentralAccessPolicy.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("ClearCentralAccessPolicy", ClearCentralAccessPolicy.Get(context));
|
||||
}
|
||||
|
||||
if(Passthru.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Passthru", Passthru.Get(context));
|
||||
}
|
||||
|
||||
if(Filter.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Filter", Filter.Get(context));
|
||||
}
|
||||
|
||||
if(Include.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Include", Include.Get(context));
|
||||
}
|
||||
|
||||
if(Exclude.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Exclude", Exclude.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Set-AuthenticodeSignature command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class SetAuthenticodeSignature : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public SetAuthenticodeSignature()
|
||||
{
|
||||
this.DisplayName = "Set-AuthenticodeSignature";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Set-AuthenticodeSignature"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Certificate parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Security.Cryptography.X509Certificates.X509Certificate2> Certificate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the IncludeChain parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> IncludeChain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the TimestampServer parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> TimestampServer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the HashAlgorithm parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> HashAlgorithm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Force parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> Force { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the FilePath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> FilePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String[]> LiteralPath { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(Certificate.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Certificate", Certificate.Get(context));
|
||||
}
|
||||
|
||||
if(IncludeChain.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("IncludeChain", IncludeChain.Get(context));
|
||||
}
|
||||
|
||||
if(TimestampServer.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("TimestampServer", TimestampServer.Get(context));
|
||||
}
|
||||
|
||||
if(HashAlgorithm.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("HashAlgorithm", HashAlgorithm.Get(context));
|
||||
}
|
||||
|
||||
if(Force.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Force", Force.Get(context));
|
||||
}
|
||||
|
||||
if(FilePath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("FilePath", FilePath.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Set-ExecutionPolicy command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class SetExecutionPolicy : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public SetExecutionPolicy()
|
||||
{
|
||||
this.DisplayName = "Set-ExecutionPolicy";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Set-ExecutionPolicy"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the ExecutionPolicy parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<Microsoft.PowerShell.ExecutionPolicy> ExecutionPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Scope parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<Microsoft.PowerShell.ExecutionPolicyScope> Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Force parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> Force { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(ExecutionPolicy.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("ExecutionPolicy", ExecutionPolicy.Get(context));
|
||||
}
|
||||
|
||||
if(Scope.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Scope", Scope.Get(context));
|
||||
}
|
||||
|
||||
if(Force.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Force", Force.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
//
|
||||
// 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.Security.Activities
|
||||
{
|
||||
/// <summary>
|
||||
/// Activity to invoke the Microsoft.PowerShell.Security\Unprotect-CmsMessage command in a Workflow.
|
||||
/// </summary>
|
||||
[System.CodeDom.Compiler.GeneratedCode("Microsoft.PowerShell.Activities.ActivityGenerator.GenerateFromName", "3.0")]
|
||||
public sealed class UnprotectCmsMessage : PSRemotingActivity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the display name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public UnprotectCmsMessage()
|
||||
{
|
||||
this.DisplayName = "Unprotect-CmsMessage";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "Microsoft.PowerShell.Security\\Unprotect-CmsMessage"; } }
|
||||
|
||||
// Arguments
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Content parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the EventLogRecord parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.PSObject> EventLogRecord { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Path parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the LiteralPath parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.String> LiteralPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the IncludeContext parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.SwitchParameter> IncludeContext { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the To parameter.
|
||||
/// </summary>
|
||||
[ParameterSpecificCategory]
|
||||
[DefaultValue(null)]
|
||||
public InArgument<System.Management.Automation.CmsMessageRecipient[]> To { get; set; }
|
||||
|
||||
|
||||
// Module defining this command
|
||||
|
||||
|
||||
// Optional custom code for this activity
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
/// </summary>
|
||||
/// <param name="context">The NativeActivityContext for the currently running activity.</param>
|
||||
/// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
|
||||
/// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
|
||||
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(Content.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Content", Content.Get(context));
|
||||
}
|
||||
|
||||
if(EventLogRecord.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("EventLogRecord", EventLogRecord.Get(context));
|
||||
}
|
||||
|
||||
if(Path.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Path", Path.Get(context));
|
||||
}
|
||||
|
||||
if(LiteralPath.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("LiteralPath", LiteralPath.Get(context));
|
||||
}
|
||||
|
||||
if(IncludeContext.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("IncludeContext", IncludeContext.Get(context));
|
||||
}
|
||||
|
||||
if(To.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("To", To.Get(context));
|
||||
}
|
||||
|
||||
|
||||
return new ActivityImplementationContext() { PowerShellInstance = invoker };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user