As the message suggests, the error there is because Invoke-WebRequest
cannot parse the $url
variable that's being passed to it as a parameter. The message is saying that $url
includes System.Collections.Hashtable.Sitecore.InstanceName
- which suggests to me that there's something wrong with the variable replacement when the $siteName
variable is being set up.
$siteName
should just be a string from your psd1
file, rather than a collection.
Your question doesn't include the data from your psd1
data file, but the first thing I'd check is that there's not a problem with that which is causing the value of Node.Sitecore.InstanceName
to be something other than string.
Just to avoid any possible confusion - I did put some annotation into the example data I gave in my answer to your previous question:
The bit highlighted in red there was just annotation - that should not be in the real file...