diff --git a/UET/Redpoint.Uet.Workspace/PhysicalGit/DefaultPhysicalGitCheckout.cs b/UET/Redpoint.Uet.Workspace/PhysicalGit/DefaultPhysicalGitCheckout.cs index b7f86915..b21ab2b7 100644 --- a/UET/Redpoint.Uet.Workspace/PhysicalGit/DefaultPhysicalGitCheckout.cs +++ b/UET/Redpoint.Uet.Workspace/PhysicalGit/DefaultPhysicalGitCheckout.cs @@ -139,7 +139,9 @@ await _processExecutor.ExecuteAsync( _logger.LogInformation("Ensuring Git is up-to-date..."); var script = """ - Install-Module -Name Microsoft.WinGet.Client -Force; + if ($null -eq (Get-InstalledModule -ErrorAction SilentlyContinue -Name Microsoft.WinGet.Client)) { + Install-Module -Name Microsoft.WinGet.Client -Force; + } Install-WinGetPackage -Id Microsoft.Git -Mode Silent; """; var encodedScript = Convert.ToBase64String(Encoding.Unicode.GetBytes(script));