Open SonOfSafwat opened 4 years ago
@ASafwatAli can you provide the log for what you are seeing?
Nothing should have changed from a Chocolatey stand point with regard to the options that you can pass to the install command.
Sure I’ll add the logs shortly. I can submit a PR with the fixes that worked for me.
@gep13 I've extracted some of the logs, but they're pretty big and contain personal information.
This is the log for choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'"
. Again Those errors disappeared as soon as I fixed the command parameters as mentioned.
I've also created a one click link with the mentioned 4 commands to test it out http://boxstarter.org/package/url?https://raw.githubusercontent.com/ASafwatAli/win-dev-setup/choco-errors-test/choco-errors.ps1
`
chocolatey-core.extension v1.3.5.1 [Approved] chocolatey-core.extension package files install completed. Performing other installation steps. Installed/updated chocolatey-core extensions. The install of chocolatey-core.extension was successful. Software installed to 'C:\ProgramData\chocolatey\extensions\chocolatey-core' [NuGet] Installing 'chocolatey 0.10.15'. [NuGet] Successfully installed 'chocolatey 0.10.15'.
chocolatey v0.10.15 [Approved] chocolatey package files install completed. Performing other installation steps. ERROR: The string is missing the terminator: '. The install of chocolatey was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall.ps1'. See log for details. [NuGet] Installing 'git.install 2.27.0'. [NuGet] Successfully installed 'git.install 2.27.0'.
git.install v2.27.0 [Approved] git.install package files install completed. Performing other installation steps. ERROR: The string is missing the terminator: '. The install of git.install was NOT successful. Error while running 'C:\ProgramData\chocolatey\lib\git.install\tools\chocolateyInstall.ps1'. See log for details. [NuGet] Installing 'git 2.27.0'. [NuGet] Successfully installed 'git 2.27.0'.
git v2.27.0 [Approved] git package files install completed. Performing other installation steps. The install of git was successful. Software install location not explicitly set, could be in package or default install location if installer.
Chocolatey installed 2/4 packages. 2 packages failed. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
ErrorRecord : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
WasThrownFromThrowStatement : False
Message : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.ArgumentException: Second path fragment must not be a drive or UNC name.
Parameter name: path2
at System.IO.Path.InternalCombine(String path1, String path2)
at System.IO.FileSystemEnumerableIterator1.GetFullSearchString(String fullPath, String searchPattern) at System.IO.FileSystemEnumerableIterator
1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption) at NuGet.PhysicalFileSystem.GetFiles(String path, String filter, Boolean recursive) at NuGet.LocalPackageRepository.<GetPackageFiles>d__31.MoveNext() at NuGet.LocalPackageRepository.<GetPackages>d__28.MoveNext() at NuGet.CollectionExtensions.AddRange[T](ICollection
1 collection, IEnumerable1 items) at NuGet.LocalPackageRepository.FindPackagesById(Func
2 openPackage, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted)
at chocolatey.infrastructure.app.services.NugetService.install_run(ChocolateyConfiguration config, Action1 continueAction) at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_function[T](ChocolateyConfiguration config, Func
2 function)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_run(ChocolateyConfiguration config)
at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action1 parseArgs) at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container) at CallSite.Target(Closure , CallSite , Object , Object ) TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception) StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction
2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary2 functionsToDefine, List
1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Objec
t input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.1 variablesToDefine, Dictionary
2 functionsToDefine, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
at Microsoft.PowerShell.Commands.InvokeCommandCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
Boxstarter: Error from Chocolatey:
ErrorRecord : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
WasThrownFromThrowStatement : False
Message : Exception calling "Run" with "1" argument(s): "Second path fragment must not be a drive or UNC name.
Parameter name: path2"
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.ArgumentException: Second path fragment must not be a drive or UNC name.
Parameter name: path2
at System.IO.Path.InternalCombine(String path1, String path2)
at System.IO.FileSystemEnumerableIterator1.GetFullSearchString(String fullPath, String searchPattern) at System.IO.FileSystemEnumerableIterator
1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption) at NuGet.PhysicalFileSystem.GetFiles(String path, String filter, Boolean recursive) at NuGet.LocalPackageRepository.<GetPackageFiles>d__31.MoveNext() at NuGet.LocalPackageRepository.<GetPackages>d__28.MoveNext() at NuGet.CollectionExtensions.AddRange[T](ICollection
1 collection, IEnumerable1 items) at NuGet.LocalPackageRepository.FindPackagesById(Func
2 openPackage, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted)
at chocolatey.infrastructure.app.services.NugetService.install_run(ChocolateyConfiguration config, Action1 continueAction) at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_function[T](ChocolateyConfiguration config, Func
2 function)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_run(ChocolateyConfiguration config)
at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action1 parseArgs) at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container) at CallSite.Target(Closure , CallSite , Object , Object ) TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception) StackTrace : at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction
2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary2 functionsToDefine, List
1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Objec
t input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.1 variablesToDefine, Dictionary
2 functionsToDefine, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
at Microsoft.PowerShell.Commands.InvokeCommandCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
`
The following commands cause errors due to being obsolete:
choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'"
choco install -y Microsoft-Hyper-V-All --source="'windowsFeatures'"
choco install -y visualstudio2017community --package-parameters="'--add Microsoft.VisualStudio.Component.Git'"
choco install -y Microsoft-Windows-Subsystem-Linux --source="'windowsfeatures'"
After checking chocolatey, I believe they changed how to reference params. Hence, I suggest updating those scripts and similar to the following
choco install -y git --params "/GitAndUnixToolsOnPath /WindowsTerminal"
choco install -y -source windowsfeatures Microsoft-Hyper-V-All
choco install -y visualstudio2017community --params="--add Microsoft.VisualStudio.Component.Git"
choco install -y -source windowsfeatures Microsoft-Windows-Subsystem-Linux