forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShowCommandModuleInfo.cs
More file actions
55 lines (49 loc) · 1.58 KB
/
Copy pathShowCommandModuleInfo.cs
File metadata and controls
55 lines (49 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//-----------------------------------------------------------------------
// Copyright © Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Microsoft.PowerShell.Commands.ShowCommandExtension
{
using System;
using System.Management.Automation;
/// <summary>
/// Implements a facade around PSModuleInfo and its deserialized counterpart
/// </summary>
public class ShowCommandModuleInfo
{
/// <summary>
/// Creates an instance of the ShowCommandModuleInfo class based on a CommandInfo object
/// </summary>
///
/// <param name="other">
/// The object to wrap.
/// </param>
public ShowCommandModuleInfo(PSModuleInfo other)
{
if (null == other)
{
throw new ArgumentNullException("other");
}
this.Name = other.Name;
}
/// <summary>
/// Creates an instance of the ShowCommandModuleInfo class based on a PSObject object
/// </summary>
///
/// <param name="other">
/// The object to wrap.
/// </param>
public ShowCommandModuleInfo(PSObject other)
{
if (null == other)
{
throw new ArgumentNullException("other");
}
this.Name = other.Members["Name"].Value as string;
}
/// <summary>
/// Gets the name of this module
/// </summary>
public string Name { get; private set; }
}
}