choco icon indicating copy to clipboard operation
choco copied to clipboard

When installing many packages, powershell can't find Test-Path cmdlet

Open simonmb opened this issue 3 years ago • 0 comments

What You Are Seeing?

ERROR: The term 'Test-Path' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. The upgrade of winmerge was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1'. See log for details.

What is Expected?

That the installation goes through.

How Did You Get This To Happen? (Steps to Reproduce)

I ran following command cup winmerge -y, the program not being installed. I also tried choco install winmerge -y. This is not a winmerge package error. It also happens to me with other packages. I just used winmerge as example. It is not the same as this issue 1288.

System Details

  • OS Build: 10.0.17763.0
  • Windows PowerShell version: 5.1.17763.2931
  • Chocolatey version: 1.1.0

Output Log

Full Log Output

2022-09-21 21:50:27,826 4728 [DEBUG] - XmlConfiguration is now operational
2022-09-21 21:50:27,873 4728 [INFO ] - ============================================================
2022-09-21 21:50:28,076 4728 [INFO ] - Chocolatey v1.1.0
2022-09-21 21:50:28,076 4728 [DEBUG] - Chocolatey is running on Windows v 10.0.17763.0
2022-09-21 21:50:28,076 4728 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2022-09-21 21:50:28,091 4728 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2022-09-21 21:50:28,091 4728 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" upgrade winmerge -y --debug --verbose
2022-09-21 21:50:28,107 4728 [DEBUG] - Received arguments: upgrade winmerge -y --debug --verbose
2022-09-21 21:50:28,154 4728 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2022-09-21 21:50:28,154 4728 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2022-09-21 21:50:28,170 4728 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2022-09-21 21:50:28,232 4728 [DEBUG] - Performing validation checks.
2022-09-21 21:50:28,232 4728 [DEBUG] - Global Configuration Validation Checks:
2022-09-21 21:50:28,232 4728 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2022-09-21 21:50:28,248 4728 [DEBUG] - System State Validation Checks:
2022-09-21 21:50:28,248 4728 [DEBUG] -  Reboot Requirement Checks:
2022-09-21 21:50:28,248 4728 [DEBUG] -  - Pending Computer Rename = Checked
2022-09-21 21:50:28,248 4728 [DEBUG] -  - Pending Component Based Servicing = Checked
2022-09-21 21:50:28,263 4728 [DEBUG] -  - Pending Windows Auto Update = Checked
2022-09-21 21:50:28,263 4728 [DEBUG] -  - Pending File Rename Operations = Checked
2022-09-21 21:50:28,263 4728 [DEBUG] -  - Pending Windows Package Installer = Checked
2022-09-21 21:50:28,263 4728 [DEBUG] -  - Pending Windows Package Installer SysWow64 = Checked
2022-09-21 21:50:28,263 4728 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2022-09-21 21:50:28,263 4728 [DEBUG] - The source 'https://community.chocolatey.org/api/v2/;\\t3a-srv-159-107\tuhhv8$\packages' evaluated to a 'normal' source type
2022-09-21 21:50:28,279 4728 [DEBUG] - 
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2022-09-21 21:50:28,294 4728 [DEBUG] - Configuration: CommandName='upgrade'|
CacheLocation='C:\Users\t3aadmin1.TU-HARBURG\AppData\Local\Temp\chocolatey'|

ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://community.chocolatey.org/api/v2/;\\t3a-srv-159-107\tuhhv8$\packages'|

SourceType='normal'|Debug='True'|Verbose='True'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|DisableCompatibilityChecks='False'|
AcceptLicense='True'|AllowUnofficialBuild='False'|Input='winmerge'|
AllVersions='False'|SkipPackageInstallProvider='False'|
PackageNames='winmerge'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.17763.0'|
Information.PlatformName='Windows Server 2016'|
Information.ChocolateyVersion='1.1.0.0'|
Information.ChocolateyProductVersion='1.1.0'|
Information.FullName='choco, Version=1.1.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='t3aadmin1'|
Information.UserDomainName='TU-HARBURG'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\WINDOWS\system32'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|Proxy.BypassOnLocal='True'|
TemplateCommand.Command='unknown'|
2022-09-21 21:50:28,310 4728 [DEBUG] - _ Chocolatey:ChocolateyUpgradeCommand - Normal Run Mode _
2022-09-21 21:50:28,310 4728 [INFO ] - Upgrading the following packages:
2022-09-21 21:50:28,310 4728 [INFO ] - winmerge
2022-09-21 21:50:28,310 4728 [INFO ] - By upgrading, you accept licenses for the packages.
2022-09-21 21:50:28,404 4728 [WARN ] - winmerge is not installed. Installing...
2022-09-21 21:50:28,435 4728 [DEBUG] - Using 'https://community.chocolatey.org/api/v2/'.
2022-09-21 21:50:28,747 4728 [DEBUG] - - Supports prereleases? 'True'.
2022-09-21 21:50:28,747 4728 [DEBUG] - - Is ServiceBased? 'True'.
2022-09-21 21:50:28,888 4728 [DEBUG] - Package 'winmerge' found on source 'https://community.chocolatey.org/api/v2/'
2022-09-21 21:50:28,904 4728 [DEBUG] - Using '\\t3a-srv-159-107\tuhhv8$\packages'.
2022-09-21 21:50:28,904 4728 [DEBUG] - - Supports prereleases? 'True'.
2022-09-21 21:50:28,904 4728 [DEBUG] - - Is ServiceBased? 'False'.
2022-09-21 21:50:29,357 4728 [INFO ] - [NuGet] Installing 'winmerge 2.16.22'.
2022-09-21 21:50:29,388 4728 [DEBUG] - [NuGet] Added file 'chocolateyInstall.ps1' to folder 'winmerge\tools'.
2022-09-21 21:50:29,388 4728 [DEBUG] - [NuGet] Added file 'winmerge.nupkg' to folder 'winmerge'.
2022-09-21 21:50:29,653 4728 [DEBUG] - [NuGet] Added file 'winmerge.nuspec' to folder 'winmerge'.
2022-09-21 21:50:29,653 4728 [INFO ] - [NuGet] Successfully installed 'winmerge 2.16.22'.
2022-09-21 21:50:29,653 4728 [INFO ] - 
winmerge v2.16.22 [Approved]
2022-09-21 21:50:29,669 4728 [INFO ] - winmerge package files upgrade completed. Performing other installation steps.
2022-09-21 21:50:29,856 4728 [DEBUG] - Setting installer args for winmerge
2022-09-21 21:50:29,856 4728 [DEBUG] - Setting package parameters for winmerge
2022-09-21 21:50:29,856 4728 [DEBUG] - Contents of 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1':
2022-09-21 21:50:29,872 4728 [DEBUG] - $ErrorActionPreference = 'Stop'

$packageName    = 'WinMerge'
$url32          = 'https://github.com/WinMerge/winmerge/releases/download/v2.16.22/WinMerge-2.16.22-Setup.exe'
$checksum32     = '1bb6341272182a677f0fd614d48ca7915ede926b3f5745d5144377f82a2f8d45'
$checksumType32 = 'sha256'
$url64          = 'https://github.com/WinMerge/winmerge/releases/download/v2.16.22/WinMerge-2.16.22-x64-Setup.exe'
$checksum64     = 'c56739866703c81c5d23715857007fd9a1023c46f30fe124eac83191ae78d93d'
$checksumType64 = 'sha256'

$packageArgs = @{
  packageName            = $packageName
  fileType               = 'EXE'
  url                    = $url32
  checksum               = $checksum32
  checksumType           = $checksumType32
  url64bit               = $url64
  checksum64             = $checksum64
  checksumType64         = $checksumType64
  silentArgs             = '/VERYSILENT /SP- /NORESTART'
  validExitCodes         = @(0)
  registryUninstallerKey = $packageName
}

Install-ChocolateyPackage @packageArgs

2022-09-21 21:50:29,903 4728 [DEBUG] - Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''']
2022-09-21 21:50:29,919 4728 [DEBUG] - Redirecting System.Management.Automation.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35, requested by ''
2022-09-21 21:50:30,950 4728 [ERROR] - ERROR: The term 'Test-Path' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin)
   at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)
   at System.Management.Automation.ExecutionContext.CreateCommand(String command)
   at System.Management.Automation.CommandNode.CreateCommandProcessor(Int32& index, ExecutionContext context)
   at System.Management.Automation.CommandNode.AddToPipeline(PipelineProcessor pipeline, ExecutionContext context)
   at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
   at System.Management.Automation.ParseTreeNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
   at System.Management.Automation.ExpressionNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
   at System.Management.Automation.ifStatementNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
   at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)
2022-09-21 21:50:30,997 4728 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] exited with '-1'.
2022-09-21 21:50:30,997 4728 [DEBUG] - Calling command ['"C:\WINDOWS\System32\shutdown.exe" /a']
2022-09-21 21:50:31,044 4728 [DEBUG] - Command ['"C:\WINDOWS\System32\shutdown.exe" /a'] exited with '1116'
2022-09-21 21:50:31,231 4728 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\winmerge'
2022-09-21 21:50:31,231 4728 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\winmerge\winmerge.nupkg'
  with checksum 'EC9F0DA0E427B4FEAA880CD5EAEA1AE9'
2022-09-21 21:50:31,231 4728 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\winmerge\winmerge.nuspec'
  with checksum 'E5AB7F4FF3C5385FB66C748CAB8C0A2D'
2022-09-21 21:50:31,231 4728 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1'
  with checksum '9B1BDED7361055E691C2671170CC75AE'
2022-09-21 21:50:31,247 4728 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\winmerge.2.16.22\.arguments".
2022-09-21 21:50:31,262 4728 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\winmerge.2.16.22\.extra".
2022-09-21 21:50:31,262 4728 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\winmerge.2.16.22\.version".
2022-09-21 21:50:31,262 4728 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\winmerge.2.16.22\.sxs".
2022-09-21 21:50:31,262 4728 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\winmerge.2.16.22\.pin".
2022-09-21 21:50:31,262 4728 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\winmerge".
2022-09-21 21:50:31,278 4728 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2022-09-21 21:50:31,278 4728 [ERROR] - The upgrade of winmerge was NOT successful.
2022-09-21 21:50:31,278 4728 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1'.
 See log for details.
2022-09-21 21:50:31,278 4728 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\winmerge'
 to 'C:\ProgramData\chocolatey\lib-bad\winmerge'
2022-09-21 21:50:33,302 4728 [DEBUG] - Attempting to delete file "C:\Users\t3aadmin1.TU-HARBURG\AppData\Local\NuGet\Cache\winmerge.2.16.22.nupkg".
2022-09-21 21:50:33,317 4728 [WARN ] - 
Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2022-09-21 21:50:33,317 4728 [INFO ] - 
2022-09-21 21:50:33,317 4728 [ERROR] - Failures
2022-09-21 21:50:33,317 4728 [ERROR] -  - winmerge (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\winmerge\tools\chocolateyInstall.ps1'.
 See log for details.
2022-09-21 21:50:33,317 4728 [WARN ] - 
Enjoy using Chocolatey? Explore more amazing features to take your
experience to the next level at
 https://chocolatey.org/compare
2022-09-21 21:50:33,317 4728 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2022-09-21 21:50:33,333 4728 [DEBUG] - Exiting with -1

simonmb avatar Sep 21 '22 19:09 simonmb