File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,14 @@ foreach($RMPath in $resourceManagerPaths)
49
49
foreach ($RMFolder in $resourceManagerFolders )
50
50
{
51
51
$psd1 = Get-ChildItem - Path $RMFolder.FullName - Filter " $ ( $RMFolder.Name ) .psd1"
52
+ if ($null -eq $psd1 )
53
+ {
54
+ Write-Host " Could not find .psd1 file in folder $RMFolder "
55
+ continue
56
+ }
57
+
52
58
Import-LocalizedData - BindingVariable ModuleMetadata - BaseDirectory $psd1.DirectoryName - FileName $psd1.Name
53
-
59
+
54
60
$acceptedDlls = @ ()
55
61
56
62
# NestedModule Assemblies may have a folder path, just getting the dll name alone
@@ -64,7 +70,7 @@ foreach($RMPath in $resourceManagerPaths)
64
70
{
65
71
$acceptedDlls += $assembly.Split (" \" )[-1 ]
66
72
}
67
-
73
+
68
74
Write-Verbose " Removing redundant dlls in $ ( $RMFolder.Name ) "
69
75
$removedDlls = Get-ChildItem - Path $RMFolder.FullName - Filter " *.dll" - Recurse | where { $acceptedDlls -notcontains $_.Name -and ! $_.FullName.Contains (" Assemblies" ) }
70
76
$removedDlls | % { Write-Verbose " Removing $ ( $_.Name ) " ; Remove-Item $_.FullName - Force }
You can’t perform that action at this time.
0 commit comments