如何在PowerShell中创建IShellLibrary
(http://msdn.microsoft.com/en-us/library/windows/desktop/dd391719(v=vs.85).aspx)实例? IShellLibrary
接口可以从代码管理Windows 7 libraries。在PowerShell中创建IShellLibrary实例
这个Shell.Application
COM对象是否实现了IShellLibrary
接口?是否有可能在PowerShell中将shell对象转换为IShellLibrary
实例?下面是关于如何在PowerShell中Shell.Application
实例的例子:当我试图把对象的结果是
New-Object -ComObject Shell.Application
:
PS C:\Users\knut> [IShellLibrary](New-Object -ComObject Shell.Application)
Unable to find type [IShellLibrary]: make sure that the assembly containing this type is loaded.
At line:1 char:16
+ [IShellLibrary] <<<< (New-Object -ComObject Shell.Application)
+ CategoryInfo : InvalidOperation: (IShellLibrary:String) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
哪里IShellLibrary
接口在什么位置?我如何将它导入到PowerShell会话中?
能否请您提供有关如何使用P /与IShellLibrary调用PowerShell的例子吗? – knut
http://www.leeholmes.com/blog/2009/01/19/powershell-pinvoke-walkthrough/ – x0n