Following the example in this blog post, I am trying to create a new Web Application with PowerShell.

However, when I try the line:

$WebAppBuilder.ApplicationPoolPassword = "password"

I receive the following error:

Exception setting "ApplicationPoolPassword": "Cannot convert the "password" value of type "System.String" to type "System.Security.SecureString"."

How might I go about fixing this?

1 Answer 1


You will have to ConvertTo-SecureString as documented here.

Or you could use Get-Credential to retrieve password, e.g. something like this:

$credential = Get-Credential 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.