Add retry logic to the operation that updates 'powershell.config.json' (#8779)
This commit is contained in:
parent
759c4abde8
commit
34394116ff
|
@ -459,7 +459,7 @@ namespace System.Management.Automation.Configuration
|
|||
// prevents other processes from reading or writing the file while
|
||||
// the update is in progress. It also locks out readers during write
|
||||
// operations.
|
||||
using (FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
|
||||
using (FileStream fs = WaitForFile(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None))
|
||||
{
|
||||
JObject jsonObject = null;
|
||||
|
||||
|
|
Loading…
Reference in a new issue