Invoke-WebRequest : {"code":"InvalidParameterValue","data":[],"details":[],"innererror":{"code":"InvalidParameterValue","data":[],"details":[]
,"message":"Parameter market was specified with invalid value: en.","source":"StoreEdgeFD","target":"market"},"message":"Parameter market was
specified with invalid value: en.","source":"StoreEdgeFD","target":"market"}
At line:38 char:7
+ ((Invoke-WebRequest -UseBasicParsing -Uri ($Base + $Parameters)). ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Fixed the issue by changing the line to this. Probably not the best, but seems to work at the moment.
market = (Get-UICulture).Name.split("-")[1]
Thanks for creating this function, it's a huge help at the moment.