尝试在 PowerShell 中使用此类/方法时,为什么找不到类型?
[System.Web.Security.Membership]::GeneratePassword()
我是否需要安装模块或其他东西才能使用它?
最佳答案
对于那些登陆这里使用 PowerShell Core 的人,按照此链接:
https://github.com/PowerShell/PowerShell/issues/5352
.NET Core does not support System.Web.dll
因此
[System.Web.Security.Membership]::GeneratePassword()
将导致相同的 Type Not Found
即使使用 add-type
也会在 PowerShell Core 中出错修复上面。您必须推出自己的密码生成器。
关于powershell - [System.Web.Security.Membership]::GeneratePassword() - 找不到类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53307844/