diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 5c2f381d70..2a596551a4 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
-FROM mcr.microsoft.com/dotnet/nightly/sdk:5.0.100-preview.7
+FROM mcr.microsoft.com/dotnet/nightly/sdk:5.0.100-rc.1
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
diff --git a/DotnetRuntimeMetadata.json b/DotnetRuntimeMetadata.json
index 119291dccc..d6c02300df 100644
--- a/DotnetRuntimeMetadata.json
+++ b/DotnetRuntimeMetadata.json
@@ -1,8 +1,8 @@
{
"sdk": {
- "channel": "release/5.0.1xx-preview8",
- "packageVersionPattern": "5.0.0-preview.8",
- "sdkImageVersion": "5.0.100-preview.8",
- "nextChannel": "net5/preview8"
+ "channel": "release/5.0.1xx-rc1",
+ "packageVersionPattern": "5.0.0-rc.1",
+ "sdkImageVersion": "5.0.100-rc.1",
+ "nextChannel": "net5/rc1"
}
}
diff --git a/PowerShell.Common.props b/PowerShell.Common.props
index 104f2f971d..d8fb6aa59b 100644
--- a/PowerShell.Common.props
+++ b/PowerShell.Common.props
@@ -97,7 +97,7 @@
(c) Microsoft Corporation.
net5.0
- preview
+ 9.0
true
true
diff --git a/assets/files.wxs b/assets/files.wxs
index 027ff522e3..0350b192ab 100644
--- a/assets/files.wxs
+++ b/assets/files.wxs
@@ -1623,6 +1623,12 @@
+
+
+
+
+
+
@@ -3096,17 +3102,20 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -4105,11 +4114,14 @@
-
-
+
+
+
+
+
diff --git a/global.json b/global.json
index fe1d9f915f..1780ad8789 100644
--- a/global.json
+++ b/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "5.0.100-preview.8.20417.9"
+ "version": "5.0.100-rc.1.20452.10"
}
}
diff --git a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs
index 4a09321edb..1ccc3d1d22 100644
--- a/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs
+++ b/src/Microsoft.Management.UI.Internal/ManagementList/FilterCore/FilterRules/FilterRuleExtensions.cs
@@ -40,14 +40,14 @@ namespace Microsoft.Management.UI.Internal
FilterRule copy = null;
try
{
-#pragma warning disable MSLIB0003
+#pragma warning disable SYSLIB0011
formatter.Serialize(ms, rule);
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
ms.Position = 0;
-#pragma warning disable MSLIB0003
+#pragma warning disable SYSLIB0011
copy = (FilterRule)formatter.Deserialize(ms);
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
}
finally
{
diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj
index e3dc8b6256..02e3b78550 100644
--- a/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj
+++ b/src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj
@@ -2,7 +2,7 @@
PowerShell's Microsoft.PowerShell.Commands.Diagnostics project
- $(NoWarn);CS1591
+ $(NoWarn);CS1591;CA1416
Microsoft.PowerShell.Commands.Diagnostics
diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs
index 39aded7d64..14607db670 100644
--- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs
+++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhSafeHandle.cs
@@ -20,7 +20,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
}
}
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
return (PdhHelper.PdhCloseLog(handle, 0) == 0);
@@ -39,7 +38,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
}
}
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
return (PdhHelper.PdhCloseQuery(handle) == 0);
@@ -58,7 +56,6 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
}
}
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
protected override bool ReleaseHandle()
{
return (PdhHelper.PdhCloseLog(handle, 0) == 0);
diff --git a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
index cd399b2340..88727c9d96 100644
--- a/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
+++ b/src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj
@@ -2,7 +2,7 @@
PowerShell's Microsoft.PowerShell.Commands.Management project
- $(NoWarn);CS1570
+ $(NoWarn);CS1570;CA1416
Microsoft.PowerShell.Commands.Management
@@ -47,7 +47,7 @@
-
+
diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs
index 2d8e71cca0..6bc54a4748 100644
--- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs
+++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Computer.cs
@@ -123,7 +123,6 @@ namespace Microsoft.PowerShell.Commands
///
/// streaming context
///
- [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs
index b05ce1e0e6..b7f9713802 100644
--- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs
+++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs
@@ -2794,14 +2794,13 @@ namespace Microsoft.PowerShell.Commands
{
}
- [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
internal SafeLocalMemHandle(IntPtr existingHandle, bool ownsHandle)
: base(ownsHandle)
{
base.SetHandle(existingHandle);
}
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), DllImport(PinvokeDllNames.LocalFreeDllName)]
+ [DllImport(PinvokeDllNames.LocalFreeDllName)]
private static extern IntPtr LocalFree(IntPtr hMem);
protected override bool ReleaseHandle()
@@ -2877,7 +2876,7 @@ namespace Microsoft.PowerShell.Commands
internal static class SafeNativeMethods
{
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success), DllImport(PinvokeDllNames.CloseHandleDllName, SetLastError = true, ExactSpelling = true)]
+ [DllImport(PinvokeDllNames.CloseHandleDllName, SetLastError = true, ExactSpelling = true)]
public static extern bool CloseHandle(IntPtr handle);
[StructLayout(LayoutKind.Sequential)]
@@ -2999,9 +2998,6 @@ namespace Microsoft.PowerShell.Commands
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(
- SecurityAction.Demand,
- SerializationFormatter = true)]
public override void GetObjectData(
SerializationInfo info,
StreamingContext context)
diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs
index 9e1d6c69c5..cf3de73663 100644
--- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs
+++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs
@@ -2575,7 +2575,6 @@ namespace Microsoft.PowerShell.Commands
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj
index 1a993b1a5f..0f2f59cdc0 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj
+++ b/src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj
@@ -2,7 +2,7 @@
PowerShell's Microsoft.PowerShell.Commands.Utility project
- $(NoWarn);CS1570
+ $(NoWarn);CS1570;CA1416
Microsoft.PowerShell.Commands.Utility
@@ -32,8 +32,8 @@
-
-
+
+
diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs
index 9b225bdc14..60bbe552e5 100644
--- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs
+++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/trace/MshHostTraceListener.cs
@@ -52,7 +52,6 @@ namespace Microsoft.PowerShell.Commands
///
/// True if the TraceListener is being disposed, false otherwise.
///
- [SecurityPermission(SecurityAction.LinkDemand)]
protected override void Dispose(bool disposing)
{
try
@@ -76,7 +75,6 @@ namespace Microsoft.PowerShell.Commands
///
/// The trace output to be written.
///
- [SecurityPermission(SecurityAction.LinkDemand)]
public override void Write(string output)
{
try
@@ -98,7 +96,6 @@ namespace Microsoft.PowerShell.Commands
///
/// The trace output to be written.
///
- [SecurityPermission(SecurityAction.LinkDemand)]
public override void WriteLine(string output)
{
try
diff --git a/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj b/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj
index 44d4fe4875..bbc8023b1d 100644
--- a/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj
+++ b/src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj
@@ -2,7 +2,7 @@
PowerShell Host
- $(NoWarn);CS1570
+ $(NoWarn);CS1570;CA1416
Microsoft.PowerShell.ConsoleHost
diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj
index 8b8d913c65..8b3cf14f58 100644
--- a/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj
+++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj
@@ -2,13 +2,13 @@
PowerShell's Microsoft.PowerShell.CoreCLR.Eventing project
- $(NoWarn);CS1591
+ $(NoWarn);CS1591;CA1416
Microsoft.PowerShell.CoreCLR.Eventing
-
+
diff --git a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
index cfc2601024..72119525b6 100644
--- a/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
+++ b/src/Microsoft.PowerShell.SDK/Microsoft.PowerShell.SDK.csproj
@@ -18,9 +18,9 @@
-
-
-
+
+
+
@@ -30,7 +30,7 @@
-
+
diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs
index 48c9fd056d..4c7dcb146a 100644
--- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs
+++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJob.cs
@@ -387,7 +387,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
private ScheduledJob(
SerializationInfo info,
StreamingContext context)
@@ -407,7 +406,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(
SerializationInfo info,
StreamingContext context)
@@ -1058,7 +1056,6 @@ namespace Microsoft.PowerShell.ScheduledJob
}
// ISerializable
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
private ResultsInfo(
SerializationInfo info,
StreamingContext context)
@@ -1086,7 +1083,6 @@ namespace Microsoft.PowerShell.ScheduledJob
}
}
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(
SerializationInfo info,
StreamingContext context)
@@ -1208,7 +1204,6 @@ namespace Microsoft.PowerShell.ScheduledJob
}
// ISerializable
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
private StatusInfo(
SerializationInfo info,
StreamingContext context)
@@ -1248,7 +1243,6 @@ namespace Microsoft.PowerShell.ScheduledJob
}
}
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(
SerializationInfo info,
StreamingContext context)
diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs
index 175c4fdaa5..ecb4fc9caa 100644
--- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs
+++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobDefinition.cs
@@ -235,7 +235,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
private ScheduledJobDefinition(
SerializationInfo info,
StreamingContext context)
@@ -275,7 +274,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs
index 2daedddc55..8f171cd02b 100644
--- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs
+++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobOptions.cs
@@ -294,7 +294,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
private ScheduledJobOptions(
SerializationInfo info,
StreamingContext context)
@@ -327,7 +326,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs
index a507e3161a..f32f33ce00 100644
--- a/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs
+++ b/src/Microsoft.PowerShell.ScheduledJob/ScheduledJobTrigger.cs
@@ -240,7 +240,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
/// SerializationInfo.
/// StreamingContext.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
private ScheduledJobTrigger(
SerializationInfo info,
StreamingContext context)
@@ -284,7 +283,6 @@ namespace Microsoft.PowerShell.ScheduledJob
///
///
///
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj b/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj
index 41b798f6e6..a6dadabfed 100644
--- a/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj
+++ b/src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj
@@ -2,7 +2,7 @@
PowerShell's Microsoft.PowerShell.Security project
- $(NoWarn);CS1570
+ $(NoWarn);CS1570;CA1416
Microsoft.PowerShell.Security
diff --git a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj
index e2e13780fd..96fd6a0a7e 100644
--- a/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj
+++ b/src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj
@@ -2,6 +2,7 @@
PowerShell's Microsoft.WSMan.Management project
+ $(NoWarn);CA1416
Microsoft.WSMan.Management
@@ -9,7 +10,7 @@
-
+
diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs
index 6b647bd091..504325f26d 100644
--- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs
+++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/FormatTable.cs
@@ -109,7 +109,6 @@ namespace System.Management.Automation.Runspaces
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/System.Management.Automation.csproj b/src/System.Management.Automation/System.Management.Automation.csproj
index c324263e33..5500dda246 100644
--- a/src/System.Management.Automation/System.Management.Automation.csproj
+++ b/src/System.Management.Automation/System.Management.Automation.csproj
@@ -2,7 +2,7 @@
PowerShell's System.Management.Automation project
- $(NoWarn);CS1570;CS1734
+ $(NoWarn);CS1570;CS1734;CA1416
System.Management.Automation
@@ -16,16 +16,16 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs b/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs
index 8458a36c02..c10f1424cf 100644
--- a/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs
+++ b/src/System.Management.Automation/engine/ComInterop/ComRuntimeHelpers.cs
@@ -336,7 +336,7 @@ namespace System.Management.Automation.ComInterop
// This method is intended for use through reflection and should only be used directly by IUnknownReleaseNotZero
public static unsafe int IUnknownRelease(IntPtr interfacePointer)
{
- return ((delegate* stdcall)(*(*(void***)interfacePointer + 2 /* IUnknown.Release slot */)))(interfacePointer);
+ return ((delegate* unmanaged)(*(*(void***)interfacePointer + 2 /* IUnknown.Release slot */)))(interfacePointer);
}
// This method is intended for use through reflection and should not be used directly
@@ -365,7 +365,7 @@ namespace System.Management.Automation.ComInterop
fixed (ExcepInfo* pExcepInfo = &excepInfo)
fixed (uint* pArgErr = &argErr)
{
- var pfnIDispatchInvoke = (delegate* stdcall )
+ var pfnIDispatchInvoke = (delegate* unmanaged)
(*(*(void***)dispatchPointer + 6 /* IDispatch.Invoke slot */));
int hresult = pfnIDispatchInvoke(dispatchPointer,
diff --git a/src/System.Management.Automation/engine/ErrorPackage.cs b/src/System.Management.Automation/engine/ErrorPackage.cs
index fc346e2ee9..e95bb060bd 100644
--- a/src/System.Management.Automation/engine/ErrorPackage.cs
+++ b/src/System.Management.Automation/engine/ErrorPackage.cs
@@ -720,7 +720,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info != null)
@@ -1077,7 +1076,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info != null)
diff --git a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs
index 542ad8bbf7..436d2fc388 100644
--- a/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs
+++ b/src/System.Management.Automation/engine/ExtendedTypeSystemException.cs
@@ -527,7 +527,6 @@ namespace System.Management.Automation
///
/// The to populate with data.
/// The destination for this serialization.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/engine/TypeTable.cs b/src/System.Management.Automation/engine/TypeTable.cs
index a9b9fd7f69..a58bc09445 100644
--- a/src/System.Management.Automation/engine/TypeTable.cs
+++ b/src/System.Management.Automation/engine/TypeTable.cs
@@ -1838,7 +1838,6 @@ namespace System.Management.Automation.Runspaces
///
/// Serialization information.
/// Streaming context.
- [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs
index 7a7a70f929..dc580b9581 100644
--- a/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs
+++ b/src/System.Management.Automation/engine/remoting/client/RemotingErrorRecord.cs
@@ -58,7 +58,6 @@ namespace System.Management.Automation.Runspaces
///
/// Serializer information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs
index 3c631c0f4a..982a6e66cb 100644
--- a/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs
+++ b/src/System.Management.Automation/engine/remoting/common/WireDataFormat/RemoteSessionCapability.cs
@@ -107,9 +107,9 @@ namespace System.Management.Automation.Remoting
BinaryFormatter formatter = new BinaryFormatter();
using (MemoryStream stream = new MemoryStream())
{
-#pragma warning disable MSLIB0003
+#pragma warning disable SYSLIB0011
formatter.Serialize(stream, TimeZoneInfo.Local);
-#pragma warning restore MSLIB0003
+#pragma warning restore SYSLIB0011
stream.Seek(0, SeekOrigin.Begin);
byte[] result = new byte[stream.Length];
stream.Read(result, 0, (int)stream.Length);
diff --git a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs
index 72f404bce1..9e92c04589 100644
--- a/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs
+++ b/src/System.Management.Automation/engine/remoting/common/remotingexceptions.cs
@@ -489,7 +489,6 @@ namespace System.Management.Automation.Remoting
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
@@ -654,7 +653,6 @@ namespace System.Management.Automation.Remoting
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs
index 4d2a8100d0..57e360bcc6 100644
--- a/src/System.Management.Automation/help/HelpCategoryInvalidException.cs
+++ b/src/System.Management.Automation/help/HelpCategoryInvalidException.cs
@@ -123,7 +123,6 @@ namespace Microsoft.PowerShell.Commands
///
/// The to populate with data.
/// The destination for this serialization.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/help/HelpNotFoundException.cs b/src/System.Management.Automation/help/HelpNotFoundException.cs
index 355be44fd7..b604156b5c 100644
--- a/src/System.Management.Automation/help/HelpNotFoundException.cs
+++ b/src/System.Management.Automation/help/HelpNotFoundException.cs
@@ -129,7 +129,6 @@ namespace Microsoft.PowerShell.Commands
///
/// The to populate with data.
/// The destination for this serialization.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs b/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs
index 3d9e299d02..5e76b7cb3f 100644
--- a/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs
+++ b/src/System.Management.Automation/namespaces/SafeRegistryHandle.cs
@@ -31,10 +31,8 @@ namespace Microsoft.PowerShell.Commands.Internal
// registry keys, but we'll also get back 0 as an invalid handle from
// RegOpenKeyEx.
- [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
internal SafeRegistryHandle() : base(true) { }
- [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
internal SafeRegistryHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle)
{
SetHandle(preexistingHandle);
@@ -42,8 +40,7 @@ namespace Microsoft.PowerShell.Commands.Internal
[DllImport(PinvokeDllNames.RegCloseKeyDllName),
SuppressUnmanagedCodeSecurity,
- ResourceExposure(ResourceScope.None),
- ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
+ ResourceExposure(ResourceScope.None)]
internal static extern int RegCloseKey(IntPtr hKey);
protected override bool ReleaseHandle()
diff --git a/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs b/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs
index e0cd273fe2..46070ea27c 100644
--- a/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs
+++ b/src/System.Management.Automation/namespaces/TransactedRegistrySecurity.cs
@@ -190,7 +190,6 @@ namespace Microsoft.PowerShell.Commands.Internal
// The name of registry key must start with a predefined string,
// like CLASSES_ROOT, CURRENT_USER, MACHINE, and USERS. See
// MSDN's help for SetNamedSecurityInfo for details.
- [SecurityPermission(SecurityAction.Assert, UnmanagedCode=true)]
internal TransactedRegistrySecurity(string name, AccessControlSections includeSections)
: base(true, ResourceType.RegistryKey, HKeyNameToWindowsName(name), includeSections)
{
@@ -198,7 +197,6 @@ namespace Microsoft.PowerShell.Commands.Internal
}
*/
- [SecurityPermission(SecurityAction.Assert, UnmanagedCode = true)]
// Suppressed because the passed name and hkey won't change.
[SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity")]
internal TransactedRegistrySecurity(SafeRegistryHandle hKey, string name, AccessControlSections includeSections)
@@ -278,7 +276,6 @@ namespace Microsoft.PowerShell.Commands.Internal
return persistRules;
}
- [SecurityPermission(SecurityAction.Assert, UnmanagedCode = true)]
// Suppressed because the passed keyName won't change.
[SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity")]
internal void Persist(SafeRegistryHandle hKey, string keyName)
diff --git a/src/System.Management.Automation/namespaces/Win32Native.cs b/src/System.Management.Automation/namespaces/Win32Native.cs
index 41638e9b96..5833f347b6 100644
--- a/src/System.Management.Automation/namespaces/Win32Native.cs
+++ b/src/System.Management.Automation/namespaces/Win32Native.cs
@@ -146,7 +146,6 @@ namespace Microsoft.PowerShell.Commands.Internal
[DllImport(PinvokeDllNames.CloseHandleDllName, SetLastError = true)]
[ResourceExposure(ResourceScope.Machine)]
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool CloseHandle(IntPtr handle);
diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs
index 7cda5b8826..2131fee698 100644
--- a/src/System.Management.Automation/security/nativeMethods.cs
+++ b/src/System.Management.Automation/security/nativeMethods.cs
@@ -194,7 +194,6 @@ namespace System.Management.Automation.Security
CERT_FIND_HASH_STR = 20 << 16, // thumbprint
}
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[DllImport("crypt32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern
bool CertCloseStore(IntPtr hCertStore, int dwFlags);
@@ -472,7 +471,6 @@ namespace System.Management.Automation.Security
DWORD dwAddDisposition,
ref IntPtr ppStoreContext);
- [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
[DllImport("crypt32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern
bool CertFreeCertificateContext(IntPtr certContext);
diff --git a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs
index 9ee9588be6..6ed8a54f8d 100644
--- a/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs
+++ b/src/System.Management.Automation/singleshell/config/MshSnapinLoadException.cs
@@ -187,7 +187,6 @@ namespace System.Management.Automation.Runspaces
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs
index c7dc2cb258..0e855a8914 100644
--- a/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs
+++ b/src/System.Management.Automation/utils/CommandDiscoveryExceptions.cs
@@ -102,7 +102,6 @@ namespace System.Management.Automation
///
/// streaming context
///
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
@@ -389,7 +388,6 @@ namespace System.Management.Automation
///
/// streaming context
///
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/CryptoUtils.cs b/src/System.Management.Automation/utils/CryptoUtils.cs
index 4b747eeab8..43e04754fc 100644
--- a/src/System.Management.Automation/utils/CryptoUtils.cs
+++ b/src/System.Management.Automation/utils/CryptoUtils.cs
@@ -611,7 +611,6 @@ namespace System.Management.Automation.Internal
System.GC.SuppressFinalize(this);
}
- // [SecurityPermission(SecurityAction.Demand, UnmanagedCode=true)]
protected void Dispose(bool disposing)
{
if (disposing)
diff --git a/src/System.Management.Automation/utils/EncodingUtils.cs b/src/System.Management.Automation/utils/EncodingUtils.cs
index 366d749441..b5859155d1 100644
--- a/src/System.Management.Automation/utils/EncodingUtils.cs
+++ b/src/System.Management.Automation/utils/EncodingUtils.cs
@@ -38,9 +38,9 @@ namespace System.Management.Automation
{ Default, ClrFacade.GetDefaultEncoding() },
{ OEM, ClrFacade.GetOEMEncoding() },
{ Unicode, System.Text.Encoding.Unicode },
-#pragma warning disable MSLIB0001
+#pragma warning disable SYSLIB0001
{ Utf7, System.Text.Encoding.UTF7 },
-#pragma warning restore MSLIB0001
+#pragma warning restore SYSLIB0001
{ Utf8, ClrFacade.GetDefaultEncoding() },
{ Utf8Bom, System.Text.Encoding.UTF8 },
{ Utf8NoBom, ClrFacade.GetDefaultEncoding() },
diff --git a/src/System.Management.Automation/utils/ExecutionExceptions.cs b/src/System.Management.Automation/utils/ExecutionExceptions.cs
index 2b7fcd7cff..aa779ffcde 100644
--- a/src/System.Management.Automation/utils/ExecutionExceptions.cs
+++ b/src/System.Management.Automation/utils/ExecutionExceptions.cs
@@ -137,7 +137,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
@@ -537,7 +536,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
@@ -878,9 +876,7 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Context.
- [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
- public override
- void GetObjectData(SerializationInfo info, StreamingContext context)
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
@@ -987,9 +983,7 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Context.
- [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
- public override
- void GetObjectData(SerializationInfo info, StreamingContext context)
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
}
diff --git a/src/System.Management.Automation/utils/MshArgumentException.cs b/src/System.Management.Automation/utils/MshArgumentException.cs
index 26980059c0..73a117d107 100644
--- a/src/System.Management.Automation/utils/MshArgumentException.cs
+++ b/src/System.Management.Automation/utils/MshArgumentException.cs
@@ -83,7 +83,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/MshArgumentNullException.cs b/src/System.Management.Automation/utils/MshArgumentNullException.cs
index 03ab45654a..95d5dfa00d 100644
--- a/src/System.Management.Automation/utils/MshArgumentNullException.cs
+++ b/src/System.Management.Automation/utils/MshArgumentNullException.cs
@@ -94,7 +94,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs
index a6bb0dfd3f..158354bcc7 100644
--- a/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs
+++ b/src/System.Management.Automation/utils/MshArgumentOutOfRangeException.cs
@@ -81,7 +81,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/MshInvalidOperationException.cs b/src/System.Management.Automation/utils/MshInvalidOperationException.cs
index 0889fee33d..f09671cbde 100644
--- a/src/System.Management.Automation/utils/MshInvalidOperationException.cs
+++ b/src/System.Management.Automation/utils/MshInvalidOperationException.cs
@@ -52,7 +52,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/MshNotImplementedException.cs b/src/System.Management.Automation/utils/MshNotImplementedException.cs
index e6a1128a38..463be0dc05 100644
--- a/src/System.Management.Automation/utils/MshNotImplementedException.cs
+++ b/src/System.Management.Automation/utils/MshNotImplementedException.cs
@@ -52,7 +52,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/MshNotSupportedException.cs b/src/System.Management.Automation/utils/MshNotSupportedException.cs
index e6847ba6d1..f438596d52 100644
--- a/src/System.Management.Automation/utils/MshNotSupportedException.cs
+++ b/src/System.Management.Automation/utils/MshNotSupportedException.cs
@@ -52,7 +52,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/MshObjectDisposedException.cs b/src/System.Management.Automation/utils/MshObjectDisposedException.cs
index 93cf76100b..53204ab2a6 100644
--- a/src/System.Management.Automation/utils/MshObjectDisposedException.cs
+++ b/src/System.Management.Automation/utils/MshObjectDisposedException.cs
@@ -80,7 +80,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs
index 903bdc4076..4a7fa88316 100644
--- a/src/System.Management.Automation/utils/ParameterBinderExceptions.cs
+++ b/src/System.Management.Automation/utils/ParameterBinderExceptions.cs
@@ -322,7 +322,6 @@ namespace System.Management.Automation
///
/// streaming context
///
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/PlatformInvokes.cs b/src/System.Management.Automation/utils/PlatformInvokes.cs
index 8e99cdff4b..516d705947 100644
--- a/src/System.Management.Automation/utils/PlatformInvokes.cs
+++ b/src/System.Management.Automation/utils/PlatformInvokes.cs
@@ -116,14 +116,13 @@ namespace System.Management.Automation
{
}
- [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
internal SafeLocalMemHandle(IntPtr existingHandle, bool ownsHandle)
: base(ownsHandle)
{
base.SetHandle(existingHandle);
}
- [DllImport(PinvokeDllNames.LocalFreeDllName), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
+ [DllImport(PinvokeDllNames.LocalFreeDllName)]
private static extern IntPtr LocalFree(IntPtr hMem);
protected override bool ReleaseHandle()
@@ -236,7 +235,7 @@ namespace System.Management.Automation
/// This can happen if you close a handle twice, or if you call CloseHandle on a handle
/// returned by the FindFirstFile function.
///
- [DllImport(PinvokeDllNames.CloseHandleDllName, SetLastError = true)]//, ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
+ [DllImport(PinvokeDllNames.CloseHandleDllName, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
// [SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")]
internal static extern bool CloseHandle(IntPtr handle);
diff --git a/src/System.Management.Automation/utils/RuntimeException.cs b/src/System.Management.Automation/utils/RuntimeException.cs
index fe5a6c3b4b..3a2cbd5c05 100644
--- a/src/System.Management.Automation/utils/RuntimeException.cs
+++ b/src/System.Management.Automation/utils/RuntimeException.cs
@@ -55,7 +55,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/src/System.Management.Automation/utils/SessionStateExceptions.cs b/src/System.Management.Automation/utils/SessionStateExceptions.cs
index acf3d9b830..e5394a5130 100644
--- a/src/System.Management.Automation/utils/SessionStateExceptions.cs
+++ b/src/System.Management.Automation/utils/SessionStateExceptions.cs
@@ -477,7 +477,6 @@ namespace System.Management.Automation
///
/// Serialization information.
/// Streaming context.
- [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
diff --git a/test/Test.Common.props b/test/Test.Common.props
index 777680552a..5ee96f4872 100644
--- a/test/Test.Common.props
+++ b/test/Test.Common.props
@@ -4,8 +4,8 @@
Microsoft Corporation
(c) Microsoft Corporation.
- netcoreapp5.0
- 8.0
+ net5.0
+ 9.0
true
true
diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
index 6cadb0c9f6..f63f3be140 100644
--- a/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
+++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
@@ -1691,23 +1691,25 @@ Describe "Invoke-WebRequest tests" -Tags "Feature", "RequireAdminOnWindows" {
# We put Tls13 tests at pending due to modern OS limitations.
# Tracking issue https://github.com/PowerShell/PowerShell/issues/13439
+ $skipForTls1OnLinux = $IsLinux -and $env:TF_BUILD
+
## Test cases for the 1st 'It'
$testCases1 = @(
@{ Test = @{SslProtocol = 'Default'; ActualProtocol = 'Default'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls'; ActualProtocol = 'Tls'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $false }
+ @{ Test = @{SslProtocol = 'Tls'; ActualProtocol = 'Tls'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
@{ Test = @{SslProtocol = 'Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls13'; ActualProtocol = 'Tls13'}; Pending = $true }
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls12, Tls13'; ActualProtocol = 'Tls13'}; Pending = $true }
@{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12, Tls13'; ActualProtocol = 'Tls11'}; Pending = $true }
- @{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls11'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls'}; Pending = $false }
+ @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12, Tls13'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls'}; Pending = $skipForTls1OnLinux }
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls13'; ActualProtocol = 'Tls'}; Pending = $true }
- @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls'}; Pending = $false }
+ @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls'}; Pending = $skipForTls1OnLinux }
# Skipping intermediary protocols is not supported on all platforms
@{ Test = @{SslProtocol = 'Tls, Tls12'; ActualProtocol = 'Tls'}; Pending = -not $IsWindows }
@{ Test = @{SslProtocol = 'Tls, Tls12'; ActualProtocol = 'Tls12'}; Pending = -not $IsWindows }
@@ -3207,22 +3209,24 @@ Describe "Invoke-RestMethod tests" -Tags "Feature", "RequireAdminOnWindows" {
# We put Tls13 tests at pending due to modern OS limitations.
# Tracking issue https://github.com/PowerShell/PowerShell/issues/13439
+ $skipForTls1OnLinux = $IsLinux -and $env:TF_BUILD
+
$testCases1 = @(
@{ Test = @{SslProtocol = 'Default'; ActualProtocol = 'Default'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls'; ActualProtocol = 'Tls'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $false }
+ @{ Test = @{SslProtocol = 'Tls'; ActualProtocol = 'Tls'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls11'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
@{ Test = @{SslProtocol = 'Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls13'; ActualProtocol = 'Tls13'}; Pending = $true }
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls12, Tls13'; ActualProtocol = 'Tls13'}; Pending = $true }
@{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls12'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12, Tls13'; ActualProtocol = 'Tls11'}; Pending = $true }
- @{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls11'}; Pending = $false }
- @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls'}; Pending = $false }
+ @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12, Tls13'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls11, Tls12'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls11'}; Pending = $skipForTls1OnLinux }
+ @{ Test = @{SslProtocol = 'Tls, Tls11, Tls12'; ActualProtocol = 'Tls'}; Pending = $skipForTls1OnLinux }
@{ Test = @{SslProtocol = 'Tls, Tls11, Tls13'; ActualProtocol = 'Tls'}; Pending = $true }
- @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls'}; Pending = $false }
+ @{ Test = @{SslProtocol = 'Tls, Tls11'; ActualProtocol = 'Tls'}; Pending = $skipForTls1OnLinux }
# Skipping intermediary protocols is not supported on all platforms
@{ Test = @{SslProtocol = 'Tls, Tls12'; ActualProtocol = 'Tls'}; Pending = -not $IsWindows }
@{ Test = @{SslProtocol = 'Tls, Tls12'; ActualProtocol = 'Tls12'}; Pending = -not $IsWindows }
diff --git a/test/tools/TestService/TestService.csproj b/test/tools/TestService/TestService.csproj
index d9a782155d..9e5f96b310 100644
--- a/test/tools/TestService/TestService.csproj
+++ b/test/tools/TestService/TestService.csproj
@@ -4,6 +4,7 @@
Very tiny windows service to do service testing
+ $(NoWarn);CA1416
TestService
Exe
true
@@ -12,7 +13,7 @@
-
+
diff --git a/test/tools/WebListener/WebListener.csproj b/test/tools/WebListener/WebListener.csproj
index ededcf7d80..45ce62fa73 100644
--- a/test/tools/WebListener/WebListener.csproj
+++ b/test/tools/WebListener/WebListener.csproj
@@ -7,8 +7,8 @@
-
-
+
+
diff --git a/tools/UpdateDotnetRuntime.ps1 b/tools/UpdateDotnetRuntime.ps1
index 2e99b0eb85..93f3a1cbb4 100644
--- a/tools/UpdateDotnetRuntime.ps1
+++ b/tools/UpdateDotnetRuntime.ps1
@@ -6,6 +6,9 @@ param (
[Parameter()]
[string]$SDKVersionOverride,
+ [Parameter()]
+ [switch]$UseNuGetOrg,
+
[Parameter()]
[switch]$UpdateMSIPackaging,
@@ -91,8 +94,9 @@ function Update-PackageVersion {
$versionPattern = (Get-Content "$PSScriptRoot/../DotnetRuntimeMetadata.json" | ConvertFrom-Json).sdk.packageVersionPattern
+ $source = if ($UseNuGetOrg) { 'nuget.org' } else { 'dotnet5' }
$packages.GetEnumerator() | ForEach-Object {
- $pkgs = Find-Package -Name $_.Key -AllVersions -AllowPrereleaseVersions -Source 'dotnet5'
+ $pkgs = Find-Package -Name $_.Key -AllVersions -AllowPrereleaseVersions -Source $source
foreach ($v in $_.Value) {
$version = $v.Version
@@ -200,7 +204,7 @@ if ($dotnetUpdate.ShouldUpdate) {
$addDotnet5Source = (-not (Get-PackageSource -Name 'dotnet5' -ErrorAction SilentlyContinue))
$addDotnet5InternalSource = (-not (Get-PackageSource -Name 'dotnet5-internal' -ErrorAction SilentlyContinue))
- if ($addDotnet5Source -or $addDotnet5InternalSource) {
+ if (!$UseNuGetOrg -and ($addDotnet5Source -or $addDotnet5InternalSource)) {
$nugetFileSources = ([xml](Get-Content .\nuget.config -Raw)).Configuration.packagesources.add
if ($addDotnet5Source) {
diff --git a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj
index 50f7158d05..0dc3e0f672 100644
--- a/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj
+++ b/tools/packaging/projects/reference/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj
@@ -14,6 +14,6 @@
-
+
diff --git a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj
index f94b69df16..3651a22939 100644
--- a/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj
+++ b/tools/packaging/projects/reference/System.Management.Automation/System.Management.Automation.csproj
@@ -9,7 +9,7 @@
-
-
+
+