Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Thank you for reaching out.
From the behavior you are seeing, it looks like the PowerShell cmdlet output is no longer being returned as a fixed string[], but instead as a dynamic collection (ArrayList). Because WCF uses a strict serializer, it expects the exact type defined in the contract, and this mismatch is causing the casting and “type not expected” errors.
There isn’t any official Microsoft article that confirms a specific change in the cmdlet response format. However, PowerShell does not guarantee a fixed collection type, so depending on the scenario or updates, the output can sometimes vary (for example, returning an ArrayList instead of an array).
To resolve this, the recommended approach is to handle the response more flexibly in your service. For example, you can normalize the output by converting the result to a string[] before serialization, or update your code to handle both ArrayList and string[] cases safely.
Please let us know if you require any further assistance, we’re happy to help. If you found this information useful, kindly mark this as "Accept Answer". So that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.