ConvertFrom-SecureString cmdlet 将安全字符串(System.Security.SecureString)转换为加密的标准字符串(System.String)。 与安全字符串不同,加密的标准字符串可以保存在文件中供以后使用。 可以使用 ConvertTo-SecureString cmdlet 将加密的标准字符串转换回其安全字符串格式。
第二个命令显示$Secure变量的内容。 由于$Secure变量包含安全字符串,因此 PowerShell 仅显示System.Security.SecureString类型。 第三个命令使用ConvertFrom-SecureStringcmdlet 将$Secure变量中的安全字符串转换为加密的标准字符串。 它将结果保存在$Encrypted变量中。
此处提供了有关ConvertFrom-SecureString和ConvertTo-SecureString提供的其他信息。 批注销连接or 的打印机 假设你已经知道用于注册打印机的已注册连接器的名称。 请参阅Get-UP连接orcmdlet 检索已注册连接器的列表。 连接到通用打印 获取通过特定连接or 注册的打印机列表 ...
问PowerShell : PSSession内的ConvertTo-SecureString和ConvertFrom-SecureString问题EN使用PSSession连接Exchange...
在PowerShell中,ConvertTo-SecureString和ConvertFrom-SecureStringcmdlet可用于将标准字符串System.String加密和解密为System.Security.SecureString。 这是一个字符串被加密并存储在变量中的示例: data = "This is some extremely important data" $encryptedData=ConvertTo-SecureString-String $data -AsPlainText ...
通过ConvertFrom-SecureString命令,我们可以把一个 SecureString 对象转换成一个 Encrypted Standard String(加密后的一个字符串),然后保存到文件中。在创建 Credential 时直接使用前面保存的文件,从而避免明文密码在系统中出现。 # 使用 Key 生成并保存密码文件 ...
将-AsPlainText 添加到 ConvertFrom-SecureString (#11142) 为WinCompat 添加了 WindowsPS 版本检查 (#11148) 修复某些 WinCompat 方案中的错误报告 (#11259) 添加本机二进制解析程序 (#11032)(感谢 @iSazonov!) 更新字符宽度的计算以正确遵循 CJK 字符 (#11262) ...
ConvertFrom-SecureString ConvertTo-SecureString Get-Acl Get-AuthenticodeSignature Get-CmsMessage Get-Credential Get-ExecutionPolicy 获取-Pfx证书 New-FileCatalog Protect-CmsMessage Set-Acl Set-AuthenticodeSignature Set-ExecutionPolicy Test-FileCatalog Unprotect-CmsMessage ...
$secPwd| ConvertFrom-SecureString 加密指定key 1 2 3 4 $cmd= "code" $secCmd= ConvertTo-SecureString $cmd -AsPlainText -Force $secCmdPlaintext= $secCmd| ConvertFrom-SecureString -Key (1..16) $secCmdPlaintext 解密 1 echo xxxx| ConvertTo-SecureString -Key (1..16) 示例 1 2 3 $cm...
Once the cmdlet gets the string you’ve entered, it will pipe the output toConvertFrom-SecureString. If you run just those two partsread-host -AsSecureString | ConvertFrom-SecureStringyou will get output similar to the following: ConvertFrom-SecureStringdoes the opposite of whatConvertTo-SecureString...