Add retry logic to the operation that updates 'powershell.config.json' (#8779)

This commit is contained in:
Ilya 2019-03-10 06:57:51 +05:00 committed by Dongbo Wang
parent 759c4abde8
commit 34394116ff

View file

@ -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;