GithubHelp home page GithubHelp logo

Comments (7)

raandree avatar raandree commented on May 21, 2024

This was a regression. In case of installing an MSI the path has to go to the parameter CommandLine and replaced by msiexec.exe.

In case of an MSI, you do not need to specify command line parameters as AL adds logging and /qn automatically. This is handled in Install-LWSoftwarePackage in AutomatedLabWorker.psm1.

I have tested this with these commands:

Install-LabSoftwarePackage -ComputerName bpull1 -Path E:\LabSources\SoftwarePackages\7z1602-x64.msi -PassThru -Verbose
Install-LabSoftwarePackage -ComputerName bpull1 -Path E:\LabSources\SoftwarePackages\sqlncli.msi -CommandLine '/qn IACCEPTSQLNCLILICENSETERMS=YES'
Install-LabSoftwarePackage -ComputerName bpull1 -Path E:\LabSources\SoftwarePackages\putty-64bit-0.68-installer.msi

This will be part of the next release. In the meantime just replace the file mentioned above.

from automatedlab.

Naboo2604 avatar Naboo2604 commented on May 21, 2024

thank you for help - not sure if i unterstand this correctly - "part of next release" - does you mean the commands you have tested with?

i tried both of your sample commands (putty and 7-zip) on another clientvm and received the following error:

Install-LabSoftwarePackage -ComputerName MPKCLT1 -Path D:\LabSources\SoftwarePackages\putty-64bit-0.68-installer.msi
Install-LabSoftwarePackage -ComputerName MPKCLT1 -Path D:\LabSources\SoftwarePackages\7z1602-x64.msi -PassThru -verbose

Error:

Cannot process argument transformation on parameter 'CommandLine'. Cannot convert value to type System.String.
+ CategoryInfo : InvalidData: (:) [New-InstallProcess], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,New-InstallProcess
+ PSComputerName : MPKCLT1

...are the commands correct and will be working in the next version?

from automatedlab.

raandree avatar raandree commented on May 21, 2024

I have just updated the release here: https://github.com/AutomatedLab/AutomatedLab/releases/tag/4.0.0.1. Can you test it with this one please?

I have tested with this script and it completed successfully.

New-LabDefinition -Name 'SP1' -DefaultVirtualizationEngine HyperV
Add-LabMachineDefinition -Name AL1 -Memory 1GB -OperatingSystem 'Windows 10 Enterprise'
Install-Lab

Install-LabSoftwarePackage -ComputerName AL1 -Path $labSources\SoftwarePackages\7z1602-x64.msi
Install-LabSoftwarePackage -ComputerName AL1 -Path $labSources\SoftwarePackages\sqlncli.msi -CommandLine '/qn IACCEPTSQLNCLILICENSETERMS=YES'
Install-LabSoftwarePackage -ComputerName AL1 -Path $labSources\SoftwarePackages\putty-64bit-0.68-installer.msi
Install-LabSoftwarePackage -ComputerName AL1 -Path $labSources\SoftwarePackages\ClassicShell.exe -CommandLine '/quiet ADDLOCAL=ClassicStartMenu' -AsJob
Install-LabSoftwarePackage -ComputerName AL1 -Path $labSources\SoftwarePackages\Notepad++.exe -CommandLine /S -AsJob
Install-LabSoftwarePackage -ComputerName AL1 -Path $labSources\SoftwarePackages\winrar.exe -CommandLine /S -AsJob

from automatedlab.

Naboo2604 avatar Naboo2604 commented on May 21, 2024

i had installed version 4.0.0.0 - after updating to 4.0.0.1 it works perfectly! many thanks.

for others as reference - the following sample installs all needed Software on your labclientvm´s (7-Zip,Putty,Notepad++):

# install tools on all non-domain controllers
$clientsoft = @()
$clientsoft += Get-LabSoftwarePackage -Path $labSources\SoftwarePackages\7z1602-x64.msi
$clientsoft += Get-LabSoftwarePackage -Path $labSources\SoftwarePackages\npp.7.Installer.x64.exe -Commandline '/S'
$clientsoft += Get-LabSoftwarePackage -Path $labSources\SoftwarePackages\putty-64bit-0.68-installer.msi
Install-LabSoftwarePackages -Machine ( Get-LabMachine | ? { $_.Name -ne 'DC1' } ) -SoftwarePackage $clientsoft

one wish/enhancement request: i try to install RSAT Tools for Srv 2016 - but this is a msu package - so it would be great if you can extend the installsoftwarepackage cmdlet to call "wusa.exe name-of-package.msu /quiet" if path parameter is a msu file?

many thanks

from automatedlab.

raandree avatar raandree commented on May 21, 2024

Good to hear the we are making progress.

Concerning MSU files. We are using dism.exe to add the package (see AutomatedLabWorker.psm1, 366 - 376). Installing RSAT on Windows 10 works like this:

Install-LabSoftwarePackage -Path "$labSources\SoftwarePackages\RSAT Windows 10 x64.msu" -ComputerName POSHClient1
Invoke-LabCommand -ScriptBlock { Enable-WindowsOptionalFeature -FeatureName RSATClient -Online -NoRestart } -ComputerName POSHClient1
Restart-LabVM -ComputerName POSHClient1 -Wait

If you think there is a better way, we are happy for proposals.

from automatedlab.

Naboo2604 avatar Naboo2604 commented on May 21, 2024

thank you for help in this case and sorry it was my fault:

i tried exactly what you do in in the MSU installation part of AutomatedLabWorkser.psm1, line 376 without /quiet and seen that dism stucks in my case at 1.0% for a very long time - after 5 minutes, it jumped to 100% and sayed "finished with success" - another failure was that i had not rebooted the VM after this, in the case of installing RSAT without a reboot it seems that it looks like nothing is installed - only after a reboot all the RSAT tools a displayed - so two failures in my case - not waiting too long and no reboot after all...

Enable-WindowsOptionalFeature was not necessary in my case - my commands:

Install-LabSoftwarePackage -Path "$labSources\SoftwarePackages\WindowsTH-RSAT_WS2016-x64.msu" -ComputerName CLIENT1
Restart-LabVM -ComputerName CLIENT1 -Wait

..after reboot all RSAT tools sucessfully installed...

another idea to make it more easier to handle:
do you have a function for checking pending reboots in AL? - maybe it could be called after installing package (after line 376) and give the info back to the calling cmdlet - ie:

Install-LabSoftwarePackage -Path "$labSources\SoftwarePackages\WindowsTH-RSAT_WS2016-x64.msu" -ComputerName CLIENT1
..success - you have to reboot for finishing installation...

from automatedlab.

raandree avatar raandree commented on May 21, 2024

Right, your idea of implementing a function that checks for pending reboots or enhance an existing function sounds good. Want to take the task? :)

There is already some code available: https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542

from automatedlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.