Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing executables with Powershell DSC

I am trying to install Visual Studio 2013 using PowerShell DSC but I'm running into a few issues and hoping that you guys could clear it up for me. Is DSC capable for rebooting the node and then resuming an installation of VS? Does anyone know what this error means? "vs_ultimate.exe was installed, but the specified ProductId and/or Name does not match package details"

Does anyone have any more specific examples of trying to install .exe with this method?

How does someone find out the ProductID?

Does anyone know the exact syntax of the ReturnCode?

Any help would be great!

like image 357
user3120136 Avatar asked Dec 19 '13 17:12

user3120136


People also ask

How do I install PowerShell DSC modules?

To install a DSC resource, use the Install-Module cmdlet, specifying the name of the module shown under Module name in your search results. The "TimeZone" resource exists in the "ComputerManagementDSC" module, so that is the module this example installs.

What can you do with PowerShell DSC?

DSC can be used to automatically configure multiple computers and to ensure that those machines are running identical configurations. DSC supports two different methods of operation. The simpler of the two methods is the push method, which is sometimes referred to as push mode.

Can DSC replace GPO?

Microsoft thinks servers deserve configuration options other than traditional GPOs. DSC aims to replace Group Policy on Nano Server installations. It allows you to create complex functions, apply logic and manage error handling. You can easily apply these configurations to a large number of servers.

Does DSC work with PowerShell 7?

There are three versions of DSC available: DSC 1.1 is the legacy version of DSC that originally shipped in Windows PowerShell 5.1. DSC 2.0 is the version of DSC that shipped in PowerShell 7. With the release of PowerShell 7.2, the PSDesiredStateConfiguration module is no longer included in the PowerShell package.


2 Answers

If you have a system where the software was already installed you can find the ProductID using:

Get-WmiObject -Class Win32_Product | fl Name,Version,InstallDate,InstallSource,PackageName,IdentifyingNumber

Example output:

Name              : Dell OpenManage Systems Management Software (64-Bit)
Version           : 7.3.0
InstallDate       : 20131009
InstallSource     : c:\Installs\OMSA\
PackageName       : SysMgmtx64.msi
IdentifyingNumber : {7CB08DC5-EA02-4076-BA7D-AD7736A3DE71}

Name              : Microsoft ASP.NET MVC 4 Runtime
Version           : 4.0.40804.0
InstallDate       : 20141111
InstallSource     : C:\windows\TEMP\IXP000.TMP\
PackageName       : AspNetMVC4.msi
IdentifyingNumber : {3FE312D5-B862-40CE-8E4E-A6D8ABF62736}

Where IdentifyingNumber is the GUID you should use in the package resource. Example for the above Dell software:

package OMSA
{
        Name = 'Dell OpenManage Systems Management Software (64-Bit)'
        ...
        ProductId = '7CB08DC5-EA02-4076-BA7D-AD7736A3DE71'
        Arguments = ...
}
like image 185
Greg Bray Avatar answered Sep 30 '22 18:09

Greg Bray


Quoting Heath Stewart's comment:

the ProductId is the ProductCode of the MSI, which you can get by opening the MSI in Orca (part of the Windows SDK) or you can install my module from http://psmsi.codeplex.com and get it like so:

get-msitable <yourmsi.msi> -table Property | where { $_.Property -eq "ProductCode" }
like image 31
David Gardiner Avatar answered Sep 30 '22 19:09

David Gardiner