0

在这里,我有一个关于如何在.net 项目中使用 Azure power shell cmdlet dll 的问题。我在 msdn 中查看了这个线程:使用 powershell cmdlet 我们可以使用这个命令。Remove-AzureVM -ServiceName -Name 这将涉及到 Microsoft.WindowsAzure.Management.ServiceManagement.dll 下的 dll 路径是:C:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure 我用反射器打开这个dll。而且我可以得到 RemoveAzureVMCommand 类,但是如何使用这个类来实现与 powershell cmdlet 相同的功能呢?有人可以给我分享一些光吗?非常感谢!

4

1 回答 1

0

Azure PowerShell Cmdlet 本质上是围绕 Windows Azure 服务管理 API 的包装器。您可以做的是编写自己的 C# 代码来调用“删除角色”(http://msdn.microsoft.com/en-us/library/windowsazure/jj157184.aspx)函数,该函数将删除 VM。

希望这可以帮助。

于 2012-11-22T05:44:40.207 回答