我正在使用 PowerShell 2.0(因为需要与 SP2010 兼容)在 Windows Server 2008 R2 上。我需要从 Windows 凭据管理器中检索进程的凭据。但是似乎无法使其正常工作。
我被给予了这段代码:
两行代码都会抛出错误。
分别地,我一直在尝试导入PasswordVault类。到目前为止,谷歌都没有给我提供任何帮助,我甚至还没能找到它所在的程序集。我错过了什么?
我被给予了这段代码:
[Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
(new-object Windows.Security.Credentials.PasswordVault).RetrieveAll() | % { $_.RetrievePassword(); $_ }
两行代码都会抛出错误。
Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime : Unable to find type [Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]: make sure that the assembly containing this type is loaded.
并且
(new-object Windows.Security.Credentials.PasswordVault).RetrieveAll() | % {$_.RetrievePassword(); $_ }
分别地,我一直在尝试导入PasswordVault类。到目前为止,谷歌都没有给我提供任何帮助,我甚至还没能找到它所在的程序集。我错过了什么?