none
Install Remotely Windows Server and MSI file from CSV File - urgent RRS feed

  • Question

  • I need to install onto windows servers msi file

    #Variables
    $computername = Get-Content h:\TEMP\list.txt
    $sourcefile = "\\server\netlogon\bob.msi"
    #This section will install the software
    foreach ($computer in $computername)
    {
     $destinationFolder = "\\$computer\C$\Temp"
     #This section will copy the $sourcefile to the $destinationfolder. If the Folder does not exist it will create it.
     if (!(Test-Path -path $destinationFolder))
     {
      New-Item $destinationFolder -Type Directory
     }
     Copy-Item -Path $sourcefile -Destination $destinationFolder
     Invoke-Command -ComputerName $computer -ScriptBlock {Start-Process 'c:\temp\bob.msi /QN /NORESTART'}


    • Edited by NightWing 2099 Friday, March 1, 2019 1:33 PM
    • Moved by Bill_Stewart Monday, July 29, 2019 8:05 PM This is not "scripts on demand"
    Friday, March 1, 2019 1:33 PM

All replies