本文整理汇总了C#中WindowsAzurePowershellCmdlet类的典型用法代码示例。如果您正苦于以下问题:C# WindowsAzurePowershellCmdlet类的具体用法?C# WindowsAzurePowershellCmdlet怎么用?C# WindowsAzurePowershellCmdlet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowsAzurePowershellCmdlet类属于命名空间,在下文中一共展示了WindowsAzurePowershellCmdlet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAzureDisk
// Add-AzureDisk
public DiskContext AddAzureDisk(string diskName, string mediaPath, string label, string os)
{
AddAzureDiskCmdletInfo addAzureDiskCmdletInfo = new AddAzureDiskCmdletInfo(diskName, mediaPath, label, os);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(addAzureDiskCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (DiskContext)result[0].BaseObject;
}
return null;
}
示例2: AddAzureCertificate
public ManagementOperationContext AddAzureCertificate(string serviceName, PSObject cert, string password)
{
AddAzureCertificateCmdletInfo addAzureCertificateCmdletInfo = new AddAzureCertificateCmdletInfo(serviceName, cert, password);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(addAzureCertificateCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (ManagementOperationContext)result[0].BaseObject;
}
return null;
}
示例3: AddAzureDataDisk
public PersistentVM AddAzureDataDisk(AddAzureDataDiskConfig diskConfig)
{
AddAzureDataDiskCmdletInfo addAzureDataDiskCmdletInfo = new AddAzureDataDiskCmdletInfo(diskConfig);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(addAzureDataDiskCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (PersistentVM)result[0].BaseObject;
}
return null;
}
示例4: RemoveAzureCertificate
public ManagementOperationContext RemoveAzureCertificate(string serviceName, string thumbprint, string algorithm)
{
RemoveAzureCertificateCmdletInfo removeAzureCertificateCmdletInfo = new RemoveAzureCertificateCmdletInfo(serviceName, thumbprint, algorithm);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(removeAzureCertificateCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (ManagementOperationContext)result[0].BaseObject;
}
return null;
}
示例5: RemoveAzureAffinityGroup
public ManagementOperationContext RemoveAzureAffinityGroup(string name)
{
RemoveAzureAffinityGroupCmdletInfo removeAzureAffinityGroupCmdletInfo = new RemoveAzureAffinityGroupCmdletInfo(name);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(removeAzureAffinityGroupCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (ManagementOperationContext)result[0].BaseObject;
}
return null;
}
示例6: GetAzureVM
public PersistentVMRoleContext GetAzureVM(string vmName, string serviceName)
{
GetAzureVMCmdletInfo getAzureVMCmdletInfo = new GetAzureVMCmdletInfo(vmName, serviceName);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(getAzureVMCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (PersistentVMRoleContext)result[0].BaseObject;
}
return null;
}
示例7: SaveAzureVhdStop
public string SaveAzureVhdStop(Uri source, FileInfo localFilePath, int? numThreads, string storageKey, bool overwrite, int ms)
{
SaveAzureVhdCmdletInfo saveAzureVhdCmdletInfo = new SaveAzureVhdCmdletInfo(source, localFilePath, numThreads, storageKey, overwrite);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(saveAzureVhdCmdletInfo);
return azurePowershellCmdlet.RunAndStop(ms).ToString();
}
示例8: RestartAzureVM
public void RestartAzureVM(string vmName, string serviceName)
{
RestartAzureVMCmdletInfo restartAzureVMCmdlet = new RestartAzureVMCmdletInfo(vmName, serviceName);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(restartAzureVMCmdlet);
azurePowershellCmdlet.Run();
}
示例9: RemoveAzureVNetConfig
public ManagementOperationContext RemoveAzureVNetConfig()
{
RemoveAzureVNetConfigCmdletInfo removeAzureVNetConfigCmdletInfo = new RemoveAzureVNetConfigCmdletInfo();
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(removeAzureVNetConfigCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (ManagementOperationContext)result[0].BaseObject;
}
return null;
}
示例10: GetAzureVNetGatewayKey
public SharedKeyContext GetAzureVNetGatewayKey(string vnetName, string localnet)
{
GetAzureVNetGatewayKeyCmdletInfo getAzureVNetGatewayKeyCmdletInfo = new GetAzureVNetGatewayKeyCmdletInfo(vnetName, localnet);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(getAzureVNetGatewayKeyCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (SharedKeyContext) result[0].BaseObject;
}
return null;
}
示例11: RemoveAzureEndPoint
public PersistentVMRoleContext RemoveAzureEndPoint(string epName, PersistentVMRoleContext vmRoleCtxt)
{
RemoveAzureEndpointCmdletInfo removeAzureEndPointCmdletInfo = new RemoveAzureEndpointCmdletInfo(epName, vmRoleCtxt);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(removeAzureEndPointCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (PersistentVMRoleContext)result[0].BaseObject;
}
return null;
}
示例12: NewAzureDns
public DnsServer NewAzureDns(string name, string ipAddress)
{
NewAzureDnsCmdletInfo newAzureDnsCmdletInfo = new NewAzureDnsCmdletInfo(name, ipAddress);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(newAzureDnsCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (DnsServer)result[0].BaseObject;
}
return null;
}
示例13: NewAzureDeployment
public ManagementOperationContext NewAzureDeployment(string serviceName, string packagePath, string configPath, string slot, string label, string name, bool doNotStart, bool warning)
{
NewAzureDeploymentCmdletInfo newAzureDeploymentCmdletInfo = new NewAzureDeploymentCmdletInfo(serviceName, packagePath, configPath, slot, label, name, doNotStart, warning);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(newAzureDeploymentCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (ManagementOperationContext)result[0].BaseObject;
}
return null;
}
示例14: NewAzureCertificateSetting
public CertificateSetting NewAzureCertificateSetting(string thumbprint, string store)
{
NewAzureCertificateSettingCmdletInfo newAzureCertificateSettingCmdletInfo = new NewAzureCertificateSettingCmdletInfo(thumbprint, store);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(newAzureCertificateSettingCmdletInfo);
Collection<PSObject> result = azurePowershellCmdlet.Run();
if (result.Count == 1)
{
return (CertificateSetting)result[0].BaseObject;
}
return null;
}
示例15: ImportAzureVM
public Collection<PersistentVM> ImportAzureVM(string path)
{
Collection<PersistentVM> result = new Collection<PersistentVM>();
ImportAzureVMCmdletInfo importAzureVMCmdletInfo = new ImportAzureVMCmdletInfo(path);
WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(importAzureVMCmdletInfo);
foreach (var vm in azurePowershellCmdlet.Run())
{
result.Add((PersistentVM)vm.BaseObject);
}
return result;
}