当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] ConvertTo-SecureString (Microsoft.PowerShell.Security)

作者:精品下载站 日期:2024-12-14 02:09:37 浏览:15 分类:玩电脑

ConvertTo-SecureString (Microsoft.PowerShell.Security)


ConvertTo-SecureString

模块 :Microsoft.PowerShell.Security

将纯文本或加密字符串转换为安全字符串。

句法

ConvertTo-SecureString
              [-String] <String>
              [[-SecureKey] <SecureString>]
              [<CommonParameters>]
ConvertTo-SecureString
              [-String] <String>
              [-AsPlainText]
              [-Force]
              [<CommonParameters>]
ConvertTo-SecureString
              [-String] <String>
              [-Key <Byte[]>]
              [<CommonParameters>]

描述

ConvertTo-SecureString cmdlet 将加密的标准字符串转换为安全字符串。它还可以将纯文本转换为安全字符串。它与 ConvertFrom-SecureStringRead-Host 一起使用。 cmdlet 创建的安全字符串可与需要 SecureString 类型参数的 cmdlet 或函数一起使用。可以使用 ConvertFrom-SecureString cmdlet 将安全字符串转换回加密的标准字符串。这使得它可以存储在文件中以供以后使用。

如果要转换的标准字符串是使用指定密钥通过 ConvertFrom-SecureString 加密的,则必须提供相同的密钥作为 KeySecureKey

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯