我试图接受用户名和密码作为Powershell脚本的参数,但是新的对象
$UserID="Name"
$SecurePassword=convertto-securestring -AsPlainText -Force -String $Password
New-object –TypeName System.Management.Automation.PSCredential –ArgumentList ($UserID,$SecurePassword)
Run Code Online (Sandbox Code Playgroud)
给出错误
新对象:找不到类型[ - TypeName System.Management.Automation.PSCredential - ArgumentList]:验证是否加载了包含此类型的as sembly.在C:\ ps\login.ps1:14 char:17 + ... rCredential = New-object - TypeName System.Management.Automation.PSCre ... + ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:InvalidType: (:) [New-Object],PSArgumentException + FullyQualifiedErrorId:TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
任何人都有一些线索如何解决这个问题?
我使用Per中的这个例子创建了一个简单的bean
http://per.lausten.dk/blog/2012/02/creating-your-first-managed-bean-for-xpages.html
我可以使用访问bean
helloWorld.setSomeVariable("test")和
使用helloWorld.getSomeVariable()获取值
但是,当我使用EL语言尝试它时,它不起作用 helloWorld.SomeVariable
我得到一个错误,在helloWorld中不存在SomeVariable
我可能正在做一些简单的错误,但我看不出是什么.