Clean up '#if CORE' - use SecurityZone from CoreFX (#4368)

Make `System.Management.Automation references` to package `System.Security.Permissions`, which brings back `SecurityZone` and `System.Security.Policy.Zone`.
This commit is contained in:
Ilya
2017-07-28 12:13:15 -07:00
committed by Dongbo Wang
parent 2dd371952d
commit 184a9bc85e
6 changed files with 1 additions and 34 deletions
@@ -16,24 +16,6 @@ using Microsoft.Win32;
// We use the stubs in this namespace to reduce #if/def in the code as much as possible.
namespace Microsoft.PowerShell.CoreClr.Stubs
{
#region Misc_Types
/// <summary>
/// Stub for SecurityZone
/// </summary>
public enum SecurityZone
{
MyComputer = 0,
Intranet = 1,
Trusted = 2,
Internet = 3,
Untrusted = 4,
NoZone = -1,
}
#endregion Misc_Types
#region SystemManagementStubs
// Summary:
@@ -16,6 +16,7 @@
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="4.4.0-preview3-25423-02" />
<PackageReference Include="System.Security.AccessControl" Version="4.4.0-preview3-25423-02" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="4.4.0-preview3-25423-02" />
<PackageReference Include="System.Security.Permissions" Version="4.4.0-preview3-25423-02" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.4.0-preview3-25423-02" />
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0-alpha*" />
</ItemGroup>
@@ -27,11 +27,6 @@ using Token = System.Management.Automation.Language.Token;
using Microsoft.PowerShell.Telemetry.Internal;
#endif
#if CORECLR
// Use stub for SecurityZone.
using Microsoft.PowerShell.CoreClr.Stubs;
#endif
//
// Now define the set of commands for manipulating modules.
//
@@ -24,11 +24,6 @@ using Dbg = System.Management.Automation;
using System.Runtime.InteropServices;
using System.Management.Automation.Runspaces;
#if CORECLR
// Use stubs for SecurityZone
using Microsoft.PowerShell.CoreClr.Stubs;
#endif
namespace Microsoft.PowerShell.Commands
{
#region FileSystemProvider
@@ -14,11 +14,6 @@ using System.Management.Automation.Language;
using System.Security;
using System.Security.Cryptography.X509Certificates;
#if CORECLR
// Use stub for SecurityZone
using Microsoft.PowerShell.CoreClr.Stubs;
#endif
namespace Microsoft.PowerShell
{
/// <summary>
@@ -21,7 +21,6 @@ using System.Runtime.InteropServices.ComTypes;
#if CORECLR
using System.Runtime.Loader; /* used in facade APIs related to assembly operations */
using System.Management.Automation.Host; /* used in facade API 'GetUninitializedObject' */
using Microsoft.PowerShell.CoreClr.Stubs; /* used in facade API 'GetFileSecurityZone' */
using System.Management.Automation.Internal;
using System.Text.RegularExpressions;
#else