Hello
not sure how to tell ‘Something by Someone’ needs to be installed first using the depondson.
maybe DependsOn = “[Package]Something1”
Packages = @(
ProductID = {C58378BC-0B7B-474E-855C-0000000000}
Name = 'Something1 ’
path = ‘\domain.com\files\Hosting\Package\Installer1.msi’
Shortname = ‘Some’
ProductID = {C58378BC-0B7B-474E-855C-1100000000}
Name = ‘Microsoft Runtime’
path = ‘\domain.com\files\Hosting\Package\Installer2.msi’
Shortname = ‘Ms Runtime’
DependsOn = " ???"
)
donj
2
I’m not certain what that syntax is meant to do. I’m more used to seeing:
Package SomethingOne {
ProductID = {C58378BC-0B7B-474E-855C-0000000000}
Name = 'Something1'
path = '\\domain.com\files\Hosting\Package\Installer1.msi'
Shortname = 'Some'
}
Package MSRuntime {
ProductID = {C58378BC-0B7B-474E-855C-1100000000}
Name = 'Microsoft Runtime'
path = '\\domain.com\files\Hosting\Package\Installer2.msi'
Shortname = 'Ms Runtime'
DependsOn = " [Package]SomethingOne"
}
this is what I currently have to push installs. I don’t have each package named like Sometingone or MSruntime as your example shows.
Packages = @( #Packages on all nodes.
@{
ShortName = “symantec”
Name = “scan Client”
Path = “\domain.com\files\hosting\Config\Package\scan-June24-14.msi”
ProductID = “ECEA7878-2100-4525-915D-B09174E36971”
}
@{
ShortName = 'ServerGAC'
Name = 'ServerGACInstaller1'
Path = '\\domain.com\files\hosting\Config\Package\ServerGACInstaller1.msi'
ProductID = '6E25BE84-EC08-4151-91F3-00000'
}
@{
ShortName = "URLRewrite2"
Name = "IIS URL Rewrite Module 2"
Path = "\\domain.com\files\hosting\Config\Package\rewrite_2.0.msi"
ProductID = "EB675D0A-2C95-405B-BEE8-0000000"
}
@{
ShortName = 'MySQL31'
Name = 'MySQL Connector/ODBC'
Path = '\\domain.com\files\hosting\Config\Package\mysql-connector-odbc2.msi'
ProductID = 'BBFD9BC5-BB9A-4F9C-AD77-000'
)
MimeTypes = @(
@{
FileExtension = ‘.woff’
Ensure = ‘Present’
}
)
CustomErrorFolders = @(
@{
Name = 'WebServices'
Authors = 'DR_Weboperator'
}
)
}
That’s just an array of Hash Tables. You have to use Resources inside Configurations in order to actually get DSC to do something.
I would suggest using a Composite Resource, but that might be too advanced for now.
Don is talking about this: https://msdn.microsoft.com/en-us/powershell/dsc/packageresource
Make sure you fully understand the documentation on configurations before doing anything else: https://msdn.microsoft.com/en-us/powershell/dsc/configurations
Oh yea, you’re the guy that likes to use PSD1 files for generating all of your configurations.
Something like this:
foreach ($Package in $Node.Packages)
{
$PackageName = "Baseline_Remove_Package_" + $Package.ShortName
Package $PackageName
{
Name = $Package.Name
Path = $Package.Path
Arguments = $Package.Arguments
ProductID = $Package.ProductID
Ensure = $Package.Ensure
}
}
You indeed are creating exactly what Don is saying.
“Package $PackageName” is the same as “[Package]$PackageName” when referencing the resource’s “name” - so to speak.
That must be 100% unique, so you can reference any and all resource items uniquely.
Now what you can do is add DependsOn in your PSD1 and change the script to something like this:
foreach ($Package in $Node.Packages)
{
$PackageName = "Baseline_Remove_Package_" + $Package.ShortName
Package $PackageName
{
Name = $Package.Name
Path = $Package.Path
Arguments = $Package.Arguments
ProductID = $Package.ProductID
Ensure = $Package.Ensure
if($Package.DependsOn){DependsOn = $Package.DependsOn}
}
}
I hope that helps.
thank you.
that’s me - inherited a huge DSC config.
not sure why I have a ps1 and psd1 files?
There’s nothing wrong with doing it that way, but it seems mildly unnecessary.
You can just create a Composite Resource and include that instead, but whatever floats your boat.
Using ‘if’ inside Package resource won’t work. You will have to move it outside the package block.