2016-03-30 14:20:52 -07:00
|
|
|
/********************************************************************++
|
|
|
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
--********************************************************************/
|
|
|
|
|
|
|
|
|
|
namespace System.Management.Automation
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines the names of the internal providers.
|
|
|
|
|
/// Derived classes exist for custom and single shells. In the single
|
|
|
|
|
/// shell the provider name includes the PSSnapin name. In custom
|
|
|
|
|
/// shells it does not.
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
internal abstract class ProviderNames
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the EnvironmentProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string Environment { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the Certificate
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string Certificate { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the VariableProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string Variable { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the AliasProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string Alias { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the FunctionProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string Function { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the FileSystemProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string FileSystem { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the RegistryProvider
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract string Registry { get; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The provider names for custom shells
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class CustomShellProviderNames : ProviderNames
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the EnvironmentProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Environment
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Environment";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the Certificate
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Certificate
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Certificate";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the VariableProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Variable
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Variable";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the AliasProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Alias
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Alias";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the FunctionProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Function
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Function";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the FileSystemProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string FileSystem
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "FileSystem";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the RegistryProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Registry
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Registry";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The provider names for the single shell
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class SingleShellProviderNames : ProviderNames
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the EnvironmentProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Environment
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Core\\Environment";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the Certificate
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Certificate
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Security\\Certificate";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the VariableProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Variable
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Core\\Variable";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the AliasProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Alias
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Core\\Alias";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the FunctionProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Function
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Core\\Function";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the FileSystemProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string FileSystem
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Core\\FileSystem";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the name of the RegistryProvider
|
|
|
|
|
/// </summary>
|
2016-07-29 13:02:49 -07:00
|
|
|
internal override string Registry
|
|
|
|
|
{
|
2016-03-30 14:20:52 -07:00
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return "Microsoft.PowerShell.Core\\Registry";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|