本文介绍了Powershell ConvertTo-SecureString ObjectNotFound的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
升级到 powershell 3.0 后,现有脚本停止工作并出现错误
After upgrading to powershell 3.0 existing scripts stopped working with an error
ConvertTo-SecureString : The term 'ConvertTo-SecureString' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ ConvertTo-SecureString
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (ConvertTo-SecureString:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我发现 ConvertTo-SecureString 是支持 在 PS 3.0 上.我需要以某种方式包含它吗?
I found that ConvertTo-SecureString is supported on PS 3.0. Do I need to include it somehow?
推荐答案
Import-Module 'Microsoft.PowerShell.Security'
解决了这个问题.不知道为什么这个模块默认没有加载.
fixes the issue. I don't know why this module is not loaded by default.
这篇关于Powershell ConvertTo-SecureString ObjectNotFound的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!