DSCResources/MSFT_xPackageResource/Examples/Sample4.ps1

param
(
    [String]$OutputPath = "."
)

Configuration Sample
{
    Import-DscResource -Module xPSDesiredStateConfiguration

    xPackage t1
    {
        Ensure="Present"
         Name = "Microsoft Visual Studio Express 2013 for Windows - ENU";
        Path = "\\products\public\PRODUCTS\Developers\Visual Studio 2013\Express for Windows\winexpress_full.exe"
        Arguments = "/quiet /Log c:\temp\vc.log"
        RunAsCredential = New-Object System.Management.Automation.PSCredential -ArgumentList "domain\user", (ConvertTo-SecureString -String "password" -AsPlainText -Force)
        Credential = New-Object System.Management.Automation.PSCredential -ArgumentList "domain\user", (ConvertTo-SecureString -String "password" -AsPlainText -Force)
        ProductId = ""
        InstalledCheckRegKey = "SOFTWARE\Microsoft\DevDiv\winexpress\Servicing\12.0\coremsi"
        InstalledCheckRegValueName = "Install"
        InstalledCheckRegValueData = "1"
    }
}

$Global:AllNodes=
@{
    AllNodes = @(     
                    @{
                        NodeName = "localhost";
                        RecurseValue = $true;
                        PSDscAllowPlainTextPassword = $true;
                    };                                                                                     
                );    
}


# Create the MOF file using the configuration data
Sample -OutputPath $OutputPath -ConfigurationData $Global:AllNodes

# Execute the installation of the package
Start-DscConfiguration -Path $outputPath\Sample -Verbose -Wait -Force