public string GetPathWithAcceptableDependencyVersionsInstalled()

in src/DependencyManagement/InstalledDependenciesLocator.cs [25:51]


        public string GetPathWithAcceptableDependencyVersionsInstalled()
        {
            var lastSnapshotPath = _storage.GetLatestInstalledSnapshot();
            if (lastSnapshotPath == null)
            {
                _logger.Log(isUserOnlyLog: false, Level.Information, string.Format(PowerShellWorkerStrings.NoInstalledDependencySnapshot, lastSnapshotPath));
                return null;
            }

            _logger.Log(isUserOnlyLog: false, Level.Information, string.Format(PowerShellWorkerStrings.LastInstalledDependencySnapshotFound, lastSnapshotPath));

            if (_storage.IsEquivalentDependencyManifest(lastSnapshotPath))
            {
                _logger.Log(isUserOnlyLog: false, Level.Information, string.Format(PowerShellWorkerStrings.EquivalentDependencySnapshotManifest, lastSnapshotPath));
                return lastSnapshotPath;
            }

            var dependencies = _storage.GetDependencies();
            if (dependencies.All(entry => IsAcceptableVersionInstalled(lastSnapshotPath, entry)))
            {
                _logger.Log(isUserOnlyLog: false, Level.Information, string.Format(PowerShellWorkerStrings.DependencySnapshotContainsAcceptableModuleVersions, lastSnapshotPath));
                return lastSnapshotPath;
            }

            _logger.Log(isUserOnlyLog: false, Level.Information, string.Format(PowerShellWorkerStrings.DependencySnapshotDoesNotContainAcceptableModuleVersions, lastSnapshotPath));
            return null;
        }