Skip to content

Commit 5c9ad60

Browse files
Ignore cmdlet check when it doesn't come from assembly file (#13642)
Co-authored-by: Yunchi Wang <[email protected]>
1 parent 099b48f commit 5c9ad60

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/VersionController/Models/VersionMetadataHelper.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public Version GetVersionBumpUsingSerialized(bool serialize = true)
267267
{
268268
powershell.AddScript("(Test-ModuleManifest -Path " + outputModuleManifestPath + ").NestedModules");
269269
var cmdletResult = powershell.Invoke();
270-
nestedModules = cmdletResult.Select(c => c.ToString() + ".dll");
270+
nestedModules = cmdletResult.Select(c => c.ToString());
271271
}
272272

273273
Version versionBump = Version.PATCH;
@@ -290,9 +290,17 @@ public Version GetVersionBumpUsingSerialized(bool serialize = true)
290290
}
291291

292292
requiredModules.Add(outputModuleDirectory);
293-
foreach (var nestedModule in nestedModules)
293+
foreach (var nestedModuleName in nestedModules)
294294
{
295+
// Handcrafted modules assume its nested module always is DLL file.
296+
var nestedModule = nestedModuleName + ".dll";
295297
var assemblyPath = Directory.GetFiles(outputModuleDirectory, nestedModule, SearchOption.AllDirectories).FirstOrDefault();
298+
299+
// However we support PSM1, PSD1 other nested module type. Skip this check and we need to use a different design soon.
300+
if(assemblyPath == null)
301+
{
302+
continue;
303+
}
296304
var proxy = new CmdletLoader();
297305
var newModuleMetadata = proxy.GetModuleMetadata(assemblyPath, requiredModules);
298306
var serializedCmdletName = nestedModule + ".json";

0 commit comments

Comments
 (0)