I have DSC working with 2 nodes. Pull server and nodes are 2008R2. Simple mof, one Guid, IIS install works. Now I want to take it one step forward and use a hash table. The goal is to add and remove nodes from the hash table at will and leave the mof alone. Doing this in steps so I’ll want more out of it later but I’m brand new to PS so clearly there are some basic stumbling blocks. So I have this;
Configuration AllNodeIIS {
Node $AllNodes.where{$_.Role -eq “Web”}.NodeName
{
# Install the IIS role
WindowsFeature IIS
{
Ensure = “Present”
Name = “Web-Server”
}
}
}
AllNodeIIS -ConfigData $VariableNameHoldingConfigData -Verbose;
#My thought is this would create the mof and call the hash table. Then this is the hash table;
#hash table for all nodes
$AllNodeIIS =
@{
AllNodes = @(
@{
NodeName = "real node name"
Role = "Web"
},
@{
NodeName = "real node name"
Role = "Web"
}
);
}
Without “AllNodeIIS -ConfigData $VariableNameHoldingConfigData -Verbose;” this would run and do nothing. A friend suggested I add this because I needed to invoke the config and I wanted to be able to see what was happening. After I added it I got the message;
PSDesiredStateConfiguration\Configuration : The term ‘PSDesiredStateConfiguration\Configuration’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
- configuration AllNodeIIS {
-
+ CategoryInfo : ObjectNotFound: (PSDesiredStateC...n\Configuration:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I then ran PS C:\Windows\system32> Get-Module and got this;
ModuleType Version Name ExportedCommands
Script 1.0.0.0 ISE {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content…}
Manifest 3.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature…}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Manifest 3.0.0.0 Microsoft.WSMan.Management {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP…}
Manifest 3.0.2.0 PSDesiredStateConfiguration
Binary 1.0 PSDesiredStateConfiguration {Set-DscLocalConfigurationManager, Start-DscConfiguration, Configuration, Get-DscConfiguration…}
So it’s there, right. Lost right now. It’s taking me a long time to get nowhere. Help! Hopefully I’ve given you enough info to go by. Thanks in advance.