Skip to content

Instantly share code, notes, and snippets.

@dlwyatt
Created September 24, 2014 00:39
Show Gist options
  • Save dlwyatt/e760e7070d3c1fa91ac4 to your computer and use it in GitHub Desktop.
Save dlwyatt/e760e7070d3c1fa91ac4 to your computer and use it in GitHub Desktop.
Resolve-DscConfigurationProperty update
$ConfigurationData = @{
AllNodes = @(
@{
NodeName = 'Server01'
Applications = @{
Mercurial = @{
Name = 'Mercurial 2.5.1 (x64)'
ProductId = 'F39802E0-BE92-4896-A67B-85144CF01831'
SourcePath = '\\servername\sharename\Mercurial\'
Installer = 'mercurial-2.5.1-x64.msi'
}
}
}
)
}
configuration Before
{
node $AllNodes.NodeName
{
$mercurial = Resolve-DscConfigurationProperty -Node $node -Application Mercurial
Package mercurial
{
Ensure = 'Present'
Name = $mercurial['Name']
ProductId = $mercurial['ProductId']
Path = Join-Path $mercurial['SourcePath'] $mercurial['Installer']
}
}
}
configuration After
{
node $AllNodes.NodeName
{
$sourcePath = Resolve-DscConfigurationProperty -Node $node -PropertyName Applications\Mercurial\SourcePath
$installer = Resolve-DscConfigurationProperty -Node $node -PropertyName Applications\Mercurial\Installer
Package mercurial
{
Ensure = 'Present'
Name = Resolve-DscConfigurationProperty -Node $node -PropertyName Applications\Mercurial\Name
ProductId = Resolve-DscConfigurationProperty -Node $node -PropertyName Applications\Mercurial\ProductId
Path = Join-Path $sourcePath $installer
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment