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
47 lines (41 loc) · 1.36 KB
/
Copy pathShowCommandModuleInfo.cs
File metadata and controls
47 lines (41 loc) · 1.36 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
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Management.Automation;
namespace Microsoft.PowerShell.Commands.ShowCommandExtension
{
/// <summary>
/// Implements a facade around PSModuleInfo and its deserialized counterpart.
/// </summary>
public class ShowCommandModuleInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="ShowCommandModuleInfo"/> class
/// with the specified <see cref="CommandInfo"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
/// </param>
public ShowCommandModuleInfo(PSModuleInfo other)
{
ArgumentNullException.ThrowIfNull(other);
this.Name = other.Name;
}
/// <summary>
/// Initializes a new instance of the <see cref="ShowCommandModuleInfo"/> class
/// with the specified <see cref="PSObject"/>.
/// </summary>
/// <param name="other">
/// The object to wrap.
/// </param>
public ShowCommandModuleInfo(PSObject other)
{
ArgumentNullException.ThrowIfNull(other);
this.Name = other.Members["Name"].Value as string;
}
/// <summary>
/// Gets the name of this module.
/// </summary>
public string Name { get; }
}
}