// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Management.Automation;
namespace Microsoft.PowerShell.Commands.ShowCommandExtension
{
///
/// Implements a facade around PSModuleInfo and its deserialized counterpart.
///
public class ShowCommandModuleInfo
{
///
/// Creates an instance of the ShowCommandModuleInfo class based on a CommandInfo object.
///
///
/// The object to wrap.
///
public ShowCommandModuleInfo(PSModuleInfo other)
{
if (other == null)
{
throw new ArgumentNullException("other");
}
this.Name = other.Name;
}
///
/// Creates an instance of the ShowCommandModuleInfo class based on a PSObject object.
///
///
/// The object to wrap.
///
public ShowCommandModuleInfo(PSObject other)
{
if (other == null)
{
throw new ArgumentNullException("other");
}
this.Name = other.Members["Name"].Value as string;
}
///
/// Gets the name of this module.
///
public string Name { get; private set; }
}
}