microsoft / windows-dev-box-setup-scripts

Scripts to simplify setting up a Windows developer box
MIT License
1.5k stars 368 forks source link

adding parameters for choco packages causes error #88

Open SonOfSafwat opened 4 years ago

SonOfSafwat commented 4 years ago

The following commands cause errors due to being obsolete:

After checking chocolatey, I believe they changed how to reference params. Hence, I suggest updating those scripts and similar to the following

gep13 commented 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.

SonOfSafwat commented 4 years ago

Sure I’ll add the logs shortly. I can submit a PR with the fixes that worked for me.

SonOfSafwat commented 4 years ago

@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.FileSystemEnumerableIterator1..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](ICollection1 collection, IEnumerable1 items) at NuGet.LocalPackageRepository.FindPackagesById(Func2 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, Func2 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.ActionCallInstruction2.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, List1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Objec t input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args) at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.b__0() at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action) at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsT oTop, List1 variablesToDefine, Dictionary2 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.FileSystemEnumerableIterator1..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](ICollection1 collection, IEnumerable1 items) at NuGet.LocalPackageRepository.FindPackagesById(Func2 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, Func2 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.ActionCallInstruction2.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, List1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Objec t input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args) at System.Management.Automation.ScriptBlock.<>c__DisplayClass57_0.b__0() at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action) at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsT oTop, List1 variablesToDefine, Dictionary2 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 `