in these days of deployment, playing fun moments to learn new things. One of them, and that gave us a headache for several minutes with Javi, was in the creation of an Application Pool using PowerShell. The following code is copied 100% an IIS.NET, for the creation of an Application Pool in IIS 7.0.
If you try 99 environments, will surely work correctly, however to my touched me to try it in that environment number 100 where we had a type error when assigning the Password. Researching a bit, I have seen that the class ReadHost doesn’t return a type string, but something a little "more complicated", by default the return value is assigned to aSecureStringtype. From there who at the time of assigning the Password is possible that we have wrong permissions or access.
But worry that the solution only consists of "castear" to a string value that returns ReadHost. THE following example, evidenced on line 3
Greetings @ La Finca