Ask a questionAsk a question
 

QuestionPoSh: Software installation

  • Tuesday, November 03, 2009 5:06 PMДмитрий Плохих Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello guys! How can I use msiexec switches when installing sortware with win32_product install method? E.g.  I wrote this code:
    $distrib = \\Server\Share\Product.msi
    
    $pc= 'computer'
    
    $switch='/qn'
    
    $app=[wmiclass]"\\$pc\root\cimv2:win32_Product"
    
    $app.install($distrib,$switch,$TRUE)
    
    
    But this doesn't work, what is the correct way? Thanks in advance.

All Replies

  • Tuesday, November 03, 2009 11:39 PMKarl Mitschke Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Do you get an error?

    Karl
  • Wednesday, November 04, 2009 10:06 AMДмитрий Плохих Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    No, I have a message:

    __GENUS          : 2
    __CLASS          : __PARAMETERS
    __SUPERCLASS     :
    __DYNASTY        : __PARAMETERS
    __RELPATH        :
    __PROPERTY_COUNT : 1
    __DERIVATION     : {}
    __SERVER         :
    __NAMESPACE      :
    __PATH           :
    ReturnValue      : 1639

    and full interface installation begins
  • Wednesday, November 04, 2009 4:26 PMKarl Mitschke Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    1639 tells me that the command line is incorrect on the msi

    Can you verify that you can do a /qn on your msi?

    Also, can you try:

    $switch='qn' without the slash?

    karl
  • Wednesday, November 04, 2009 4:39 PMAbqBillModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    From the Win32_Product class's Install method documentation, it looks like the options string only supports MSI properties, not msiexec.exe command-line parameters. (These are two different things.) I don't know if Win32_Product's Install method supports silent installations because I never use it (I always run msiexec.exe in a scheduled task if I need to install an MSI package on a remote machine).

    Bill