mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user