Replace GetFiles in TestModuleManifestCommand (#14317)

This commit is contained in:
xtqqczze 2020-12-09 19:59:08 +00:00 committed by GitHub
parent cb13c30467
commit f74acaa768
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -420,23 +420,13 @@ namespace Microsoft.PowerShell.Commands
try try
{ {
var allFiles = Directory.GetFiles(gacPath, assemblyFile, SearchOption.AllDirectories); return Directory.EnumerateFiles(gacPath, assemblyFile, SearchOption.AllDirectories).Any()
|| Directory.EnumerateFiles(gacPath, ngenAssemblyFile, SearchOption.AllDirectories).Any();
if (allFiles.Length == 0)
{
var allNgenFiles = Directory.GetFiles(gacPath, ngenAssemblyFile, SearchOption.AllDirectories);
if (allNgenFiles.Length == 0)
{
return false;
}
}
} }
catch catch
{ {
return false; return false;
} }
return true;
#endif #endif
} }
} }