Author Posts

June 28, 2016 at 6:19 pm

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 = " ?????????"
)

June 28, 2016 at 6:39 pm

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"
}

June 28, 2016 at 8:02 pm

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'
}
)
}

  • This reply was modified 2 years, 3 months ago by  Efff dd.
  • This reply was modified 2 years, 3 months ago by  Efff dd.

June 29, 2016 at 4:27 am

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

June 29, 2016 at 4:56 am

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.

  • This reply was modified 2 years, 3 months ago by  Kyle Berger.

June 29, 2016 at 1:51 pm

thank you.
that's me – inherited a huge DSC config.
not sure why I have a ps1 and psd1 files?

July 4, 2016 at 12:58 am

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.

July 5, 2016 at 4:51 pm

Using 'if' inside Package resource won't work. You will have to move it outside the package block.