The variable syntax

You can assign the hash table to a variable and pass the variable to the configuration parameter, as follows:

$TheData = @{
AllNodes = @(
@{
NodeName = "server1"
Roles = @('Foobar')
ExampleSoftware = @{
Name = "ExampleSoftware"
ProductId = "{b652663b-867c-4d93-bc14-8ecb0b61cfb0}"
SourcePath = "c:packages hesoftware.msi"
ConfigFile = "c:foo.txt"
}
},
@{
NodeName = "server2"
}
);
NonNodeData = @{
ConfigFileContents = (Get-Content "Config.xml")
}
}
InstallExampleSoftware -ConfigurationData $TheData

You can also assign the hash table directly to the configuration function:

InstallExampleSoftware -ConfigurationData @{
AllNodes = @(
@{
NodeName = "server1"
Roles = @('Foobar')
ExampleSoftware = @{
Name = "ExampleSoftware"
ProductId = "{b652663b-867c-4d93-bc14-8ecb0b61cfb0}"
SourcePath = "c:packages hesoftware.msi"
ConfigFile = "c:foo.txt"
}
},
@{
NodeName = "server2"
}
);
NonNodeData = @{
ConfigFileContents = (Get-Content "Config.xml")
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset