Skip to content

Commit 0fef51e

Browse files
committed
try removing shouldprocess condition in installhelper
1 parent 133a22e commit 0fef51e

File tree

1 file changed

+39
-73
lines changed

1 file changed

+39
-73
lines changed

src/code/InstallHelper.cs

Lines changed: 39 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -823,81 +823,47 @@ private ConcurrentDictionary<string, Hashtable> BeginPackageInstall(
823823
}
824824

825825
// -WhatIf processing.
826-
if (_savePkg && !_cmdletPassedIn.ShouldProcess($"Package to save: '{pkgToInstall.Name}', version: '{pkgVersion}'"))
827-
{
828-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - line 789");
826+
// if (_savePkg && !_cmdletPassedIn.ShouldProcess($"Package to save: '{pkgToInstall.Name}', version: '{pkgVersion}'"))
827+
// {
829828

830-
if (updatedPackagesHash == null)
831-
{
832-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - updatedpackageshash is null");
833-
}
834-
else
835-
{
836-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - updatedpackageshash is not null");
837-
}
838829

839-
if (pkgToInstall == null)
840-
{
841-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - packageToInstall is null");
842-
}
843-
else
844-
{
845-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - packageToInstall is not null");
846-
}
847-
848-
if (!updatedPackagesHash.ContainsKey(pkgToInstall.Name))
849-
{
830+
// if (!updatedPackagesHash.ContainsKey(pkgToInstall.Name))
831+
// {
850832

851-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - line 784");
852-
updatedPackagesHash.TryAdd(pkgToInstall.Name, new Hashtable(StringComparer.InvariantCultureIgnoreCase)
853-
{
854-
{ "isModule", "" },
855-
{ "isScript", "" },
856-
{ "psResourceInfoPkg", pkgToInstall },
857-
{ "tempDirNameVersionPath", tempInstallPath },
858-
{ "pkgVersion", "" },
859-
{ "scriptPath", "" },
860-
{ "installPath", "" }
861-
});
862-
}
863-
}
864-
else if (!_cmdletPassedIn.ShouldProcess($"Package to install: '{pkgToInstall.Name}', version: '{pkgVersion}'"))
865-
{
866-
if (updatedPackagesHash == null)
867-
{
868-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - updatedpackageshash is null 2");
869-
}
870-
else
871-
{
872-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - updatedpackageshash is not null 2");
873-
}
874-
875-
if (pkgToInstall == null)
876-
{
877-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - packageToInstall is null 2");
878-
}
879-
else
880-
{
881-
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - packageToInstall is not null 2");
882-
}
883-
884-
885-
if (!updatedPackagesHash.ContainsKey(pkgToInstall.Name))
886-
{
887-
updatedPackagesHash.TryAdd(pkgToInstall.Name, new Hashtable(StringComparer.InvariantCultureIgnoreCase)
888-
{
889-
{ "isModule", "" },
890-
{ "isScript", "" },
891-
{ "psResourceInfoPkg", pkgToInstall },
892-
{ "tempDirNameVersionPath", tempInstallPath },
893-
{ "pkgVersion", "" },
894-
{ "scriptPath", "" },
895-
{ "installPath", "" }
896-
});
897-
}
898-
}
899-
else
900-
{
833+
// _cmdletPassedIn.WriteDebug($"BeginPackageInstall() - line 784");
834+
// updatedPackagesHash.TryAdd(pkgToInstall.Name, new Hashtable(StringComparer.InvariantCultureIgnoreCase)
835+
// {
836+
// { "isModule", "" },
837+
// { "isScript", "" },
838+
// { "psResourceInfoPkg", pkgToInstall },
839+
// { "tempDirNameVersionPath", tempInstallPath },
840+
// { "pkgVersion", "" },
841+
// { "scriptPath", "" },
842+
// { "installPath", "" }
843+
// });
844+
// }
845+
// }
846+
// else if (!_cmdletPassedIn.ShouldProcess($"Package to install: '{pkgToInstall.Name}', version: '{pkgVersion}'"))
847+
// {
848+
849+
850+
851+
// if (!updatedPackagesHash.ContainsKey(pkgToInstall.Name))
852+
// {
853+
// updatedPackagesHash.TryAdd(pkgToInstall.Name, new Hashtable(StringComparer.InvariantCultureIgnoreCase)
854+
// {
855+
// { "isModule", "" },
856+
// { "isScript", "" },
857+
// { "psResourceInfoPkg", pkgToInstall },
858+
// { "tempDirNameVersionPath", tempInstallPath },
859+
// { "pkgVersion", "" },
860+
// { "scriptPath", "" },
861+
// { "installPath", "" }
862+
// });
863+
// }
864+
// }
865+
//else
866+
//{
901867
_cmdletPassedIn.WriteDebug($"BeginPackageInstall() - line 821");
902868
// Concurrent updates
903869
// Find all dependencies
@@ -931,7 +897,7 @@ private ConcurrentDictionary<string, Hashtable> BeginPackageInstall(
931897
return packagesHash;
932898
}
933899
}
934-
}
900+
//}
935901

936902
return updatedPackagesHash;
937903
}

0 commit comments

Comments
 (0)