From eb92b14433ab62edaf0afe95312d9859170efe1d Mon Sep 17 00:00:00 2001 From: Claus T Nielsen Date: Sat, 1 Sep 2018 21:26:24 +0200 Subject: [PATCH] Fix file blocking issue with webcmdlets (#7676) --- .../utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs index 00e34033e..2216245d2 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs @@ -1218,7 +1218,7 @@ namespace Microsoft.PowerShell.Commands try { // open the input file - SetRequestContent(request, new FileStream(InFile, FileMode.Open)); + SetRequestContent(request, new FileStream(InFile, FileMode.Open, FileAccess.Read, FileShare.Read)); } catch (UnauthorizedAccessException) {