DSCResources/MSFT_xPackageResource/Examples/Sample3.ps1

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

Configuration Sample
{
    Import-DscResource -Module xPSDesiredStateConfiguration

    xPackage t1
    {
        Ensure="Present"
         Name = "Microsoft Localization Studio 6.12";
        Path = "\\RAYHAYES-TESTS/Users/rayhayes/Desktop/LocStudio 6.12\LSEditor.msi"
        RunAsCredential = New-Object System.Management.Automation.PSCredential -ArgumentList "RAYHAYES-TESTS\localuser", (ConvertTo-SecureString -String "Password!01" -AsPlainText -Force)
        Credential = New-Object System.Management.Automation.PSCredential -ArgumentList "RAYHAYES-TESTS\localuser", (ConvertTo-SecureString -String "Password!01" -AsPlainText -Force)
        ProductId = "{F06FB2D7-C22C-4987-9545-7C3B15BBBD60}"
    }
}

$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