mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-22 07:15:40 +00:00
* Update TestService * Update WebListener * Update Controllers * Update ExpTest * Update MyApp * Update Logic * Update Logic * Update MyApp * Update Microsoft.Management.Infrastructure.CimCmdlets * Update Microsoft.PowerShell.Commands.Diagnostics * Update Microsoft.PowerShell.ScheduledJob * Update Microsoft.WSMan.Management * Update Microsoft.WSMan.Runtime * Update ResGen * Update TypeCatalogGen * Update commands * Update Eventing * Update Reader * Update utility * Update ShowCommand * Update trace * Update WebCmdlet * Update Common * Update CoreCLR * Update common * Update format-object * Update format-wide * Update out-file * Update out-printer * Update out-string * Update OutGridView * Update LocalAccounts * Update Commands * Update security * Update CoreCLR * Update DscSupport * Update engine * Update help * Update logging * Update namespaces * Update security * Update utils * Update config * Update perfCounters * Update tracing * Update cmdletization * Update other * Update cim * Update xml * Update CoreCLR * Update common * Update DefaultFormatters * Update out-console * Update out-textInterface * Update DisplayDatabase * Update Utilities * Update COM * Update ComInterop * Update CommandCompletion * Update debugger * Update ExperimentalFeature * Update hostifaces * Update interpreter * Update lang * Update Modules * Update parser * Update runtime * Update client * Update commands * Update common * Update fanin * Update server * Update WireDataFormat * Update Binding * Update Operations * Update interface * Update cmdletization * Update cim * Update management * Update WindowsTaskbarJumpList * Update msh
41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
using System;
|
|
using Microsoft.PowerShell.Commands.Internal.Format;
|
|
|
|
namespace Microsoft.PowerShell.Commands
|
|
{
|
|
internal static class EnumerableExpansionConversion
|
|
{
|
|
internal const string CoreOnlyString = "CoreOnly";
|
|
internal const string EnumOnlyString = "EnumOnly";
|
|
internal const string BothString = "Both";
|
|
|
|
internal static bool Convert(string expansionString, out EnumerableExpansion expansion)
|
|
{
|
|
expansion = EnumerableExpansion.EnumOnly;
|
|
if (String.Equals(expansionString, CoreOnlyString, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
expansion = EnumerableExpansion.CoreOnly;
|
|
return true;
|
|
}
|
|
|
|
if (String.Equals(expansionString, EnumOnlyString, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
expansion = EnumerableExpansion.EnumOnly;
|
|
return true;
|
|
}
|
|
|
|
if (String.Equals(expansionString, BothString, StringComparison.OrdinalIgnoreCase))
|
|
{
|
|
expansion = EnumerableExpansion.Both;
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|