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

This commit is contained in:
Ilya
2019-03-09 17:57:51 -08:00
committed by Dongbo Wang
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;