2020-03-24 19:08:37 +01:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
2018-02-13 18:23:53 +01:00
|
|
|
// Licensed under the MIT License.
|
2016-06-15 02:43:34 +02:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ComponentModel;
|
2019-04-30 07:25:11 +02:00
|
|
|
using System.Management.Automation;
|
|
|
|
using System.Text;
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
namespace Microsoft.PowerShell.Commands
|
|
|
|
{
|
2016-06-15 02:43:34 +02:00
|
|
|
/// <summary>
|
2017-01-16 22:31:14 +01:00
|
|
|
/// Create the PowerShell snap-in used to register the
|
2016-07-29 22:02:49 +02:00
|
|
|
/// Get-WinEvent cmdlet. Declaring the PSSnapIn class identifies
|
|
|
|
/// this .cs file as a PowerShell snap-in.
|
2016-06-15 02:43:34 +02:00
|
|
|
/// </summary>
|
2016-07-29 22:02:49 +02:00
|
|
|
[RunInstaller(true)]
|
|
|
|
public class GetEventPSSnapIn : PSSnapIn
|
2016-06-15 02:43:34 +02:00
|
|
|
{
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Create an instance of the GetEventPSSnapIn class.
|
|
|
|
/// </summary>
|
|
|
|
public GetEventPSSnapIn()
|
|
|
|
: base()
|
|
|
|
{
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Specify the name of the PowerShell snap-in.
|
|
|
|
/// </summary>
|
|
|
|
public override string Name
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return "Microsoft.Powershell.GetEvent";
|
|
|
|
}
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Specify the vendor of the PowerShell snap-in.
|
|
|
|
/// </summary>
|
|
|
|
public override string Vendor
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return "Microsoft";
|
|
|
|
}
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
2017-01-16 22:31:14 +01:00
|
|
|
/// Get resource information for vendor. This is a string of format: resourceBaseName,resourceName.
|
2016-07-29 22:02:49 +02:00
|
|
|
/// </summary>
|
|
|
|
public override string VendorResource
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return "GetEventResources,Vendor";
|
|
|
|
}
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Specifies the description of the PowerShell snap-in.
|
|
|
|
/// </summary>
|
|
|
|
public override string Description
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return "This PS snap-in contains Get-WinEvent cmdlet used to read Windows event log data and configuration.";
|
|
|
|
}
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
2017-01-16 22:31:14 +01:00
|
|
|
/// Get resource information for description. This is a string of format: resourceBaseName,resourceName.
|
2016-07-29 22:02:49 +02:00
|
|
|
/// </summary>
|
|
|
|
public override string DescriptionResource
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return "GetEventResources,Description";
|
|
|
|
}
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Get type files to be used for this mshsnapin.
|
|
|
|
/// </summary>
|
|
|
|
public override string[] Types
|
2016-06-15 02:43:34 +02:00
|
|
|
{
|
2016-07-29 22:02:49 +02:00
|
|
|
get
|
|
|
|
{
|
|
|
|
return _types;
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
}
|
2018-12-24 07:20:06 +01:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
private string[] _types = new string[] { "getevent.types.ps1xml" };
|
2016-06-15 02:43:34 +02:00
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Get format files to be used for this mshsnapin.
|
|
|
|
/// </summary>
|
|
|
|
public override string[] Formats
|
2016-06-15 02:43:34 +02:00
|
|
|
{
|
2016-07-29 22:02:49 +02:00
|
|
|
get
|
|
|
|
{
|
|
|
|
return _formats;
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
}
|
|
|
|
|
2016-07-29 22:02:49 +02:00
|
|
|
private string[] _formats = new string[] { "Event.format.ps1xml" };
|
|
|
|
}
|
2016-06-15 02:43:34 +02:00
|
|
|
}
|