I have five nodes in my psd1 and all five node I need a key. Right now I have the key and value in all five nodes.
Is there any way I can put this key in a common place and access in the individual nodes.
Below is the example psd1. Here I have to provide value of ArcherAPIUserPasswd is all the node. I want to put this value in a common place and refer it in the individual nodes. How do I achieve this? Please node that I do not want to remove ArcherAPIUserPasswd from individual nodes.
I am not sure I understood your question, can you can elaborate a bit more?
In general you can put the information shared across the nodes under section ‘NodeName = “*”’ without making any modification to your ps1 file. Node can override this value. An example to share common username across all nodes which is overridden by some nodes:
I understand settings under NodeName = “*” will be accessible across all nodes.
I want to access these values in same psd1 file.
something like below. I want to have all common settings under one hash table and then refer it in individual nodes.
As Nitin showed in the example he gave, everything that is under the “*” section will be done for all nodes that follow.
You dont have to “reference” it in the node itself.
If a for a specific node you dont want one of the keys to have that “general” value, you can set a different value on that specific node and it will overwrite what comes from the “*” section.
So combining Nitin example and your code, you get this: