powershell - [System.Web.Security.Membership]::GeneratePassword() - 找不到类型

标签 powershell class passwords

尝试在 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/

相关文章:

powershell - 如何避免字符串格式中添加前导空格?

powershell - 无法获取 Service Fabric PowerShell 模块

file - 如何在PowerShell中将所有Active Directory计算机读入数组?

arrays - Powershell:作为函数参数的 PSCustomObject 数组意外更改

c - C 语言中有 crypt 函数吗?或者我必须自己构建该功能?

php - 如果临时密码与数据库中的密码匹配,则更新新密码

Python 类相互静态(类)变量

Python:类中的子属性

c++ - 如何编写此方法的定义我收到错误

php - Bcrypt(4)(=4 次迭代)与 SHA512 或每个密码具有唯一盐分的不同内容?