[System.Web.Security.Membership]::GeneratePassword() - Type Not found [System.Web.Security.Membership]::GeneratePassword() - Type Not found powershell powershell

[System.Web.Security.Membership]::GeneratePassword() - Type Not found


For those landing here who are using PowerShell Core, as per this link:

https://github.com/PowerShell/PowerShell/issues/5352

.NET Core does not support System.Web.dll

As such [System.Web.Security.Membership]::GeneratePassword() will result in the same Type Not Found error in PowerShell Core even with the add-type fix above.

You'll have to roll your own password generator.


Load the assembly first:

add-type -AssemblyName System.Web[System.Web.Security.Membership]::GeneratePassword(10,0)