当前位置: 首页>>代码示例>>C#>>正文


C# WindowsAzurePowershellCmdlet.Run方法代码示例

本文整理汇总了C#中WindowsAzurePowershellCmdlet.Run方法的典型用法代码示例。如果您正苦于以下问题:C# WindowsAzurePowershellCmdlet.Run方法的具体用法?C# WindowsAzurePowershellCmdlet.Run怎么用?C# WindowsAzurePowershellCmdlet.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WindowsAzurePowershellCmdlet的用法示例。


在下文中一共展示了WindowsAzurePowershellCmdlet.Run方法的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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:13,代码来源:ServiceManagementCmdletTestHelper.cs

示例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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例4: 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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例5: NewAzureVNetGateway

        public ManagementOperationContext NewAzureVNetGateway(string vnetName)
        {
            NewAzureVNetGatewayCmdletInfo newAzureVNetGatewayCmdletInfo = new NewAzureVNetGatewayCmdletInfo(vnetName);
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(newAzureVNetGatewayCmdletInfo);
            Collection<PSObject> result = azurePowershellCmdlet.Run();

            if (result.Count == 1)
            {
                return (ManagementOperationContext)result[0].BaseObject;
            }
            return null;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例6: GetAzureSubscription

        public Collection<SubscriptionData> GetAzureSubscription()
        {
            GetAzureSubscriptionCmdletInfo getAzureSubscriptionCmdlet = new GetAzureSubscriptionCmdletInfo();
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(getAzureSubscriptionCmdlet);
            Collection<SubscriptionData> subscriptions = new Collection<SubscriptionData>();
            foreach (PSObject result in azurePowershellCmdlet.Run())
            {
                subscriptions.Add((SubscriptionData)result.BaseObject);
            }

            return subscriptions;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例7: AddAzureEndPointNoLB

        public PersistentVM AddAzureEndPointNoLB(AzureEndPointConfigInfo endPointConfig)
        {
            AddAzureEndpointCmdletInfo addAzureEndPointCmdletInfo = AddAzureEndpointCmdletInfo.BuildNoLoadBalancedCmdletInfo(endPointConfig);
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(addAzureEndPointCmdletInfo);

            Collection<PSObject> result = azurePowershellCmdlet.Run();
            if (result.Count == 1)
            {
                return (PersistentVM)result[0].BaseObject;
            }
            return null;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例8: RemoveAzureVNetGateway

        public ManagementOperationContext RemoveAzureVNetGateway(string vnetName)
        {
            GetAzureVNetGatewayKeyCmdletInfo a = new GetAzureVNetGatewayKeyCmdletInfo("aaa", "vvv");

            RemoveAzureVNetGatewayCmdletInfo removeAzureVNetGatewayCmdletInfo = new RemoveAzureVNetGatewayCmdletInfo(vnetName);
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(removeAzureVNetGatewayCmdletInfo);
            Collection<PSObject> result = azurePowershellCmdlet.Run();

            if (result.Count == 1)
            {
                return (ManagementOperationContext)result[0].BaseObject;
            }
            return null;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:14,代码来源:ServiceManagementCmdletTestHelper.cs

示例9: GetAzureVNetGateway

        public Collection<VirtualNetworkGatewayContext> GetAzureVNetGateway(string vnetName)
        {
            GetAzureVNetGatewayCmdletInfo getAzureVNetGatewayCmdletInfo = new GetAzureVNetGatewayCmdletInfo(vnetName);
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(getAzureVNetGatewayCmdletInfo);
            Collection<PSObject> result = azurePowershellCmdlet.Run();

            Collection<VirtualNetworkGatewayContext> vnetGateways = new Collection<VirtualNetworkGatewayContext>();
            foreach (PSObject re in result)
            {
                vnetGateways.Add ((VirtualNetworkGatewayContext) re.BaseObject);
            }
            return vnetGateways;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:13,代码来源:ServiceManagementCmdletTestHelper.cs

示例10: RemoveAzureDisk

        // Remove-AzureDisk
        public ManagementOperationContext RemoveAzureDisk(string diskName, bool deleteVhd)
        {
            RemoveAzureDiskCmdletInfo removeAzureDiskCmdletInfo = new RemoveAzureDiskCmdletInfo(diskName, deleteVhd);
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(removeAzureDiskCmdletInfo);

            Collection<PSObject> result = azurePowershellCmdlet.Run();
            if (result.Count == 1)
            {
                return (ManagementOperationContext)result[0].BaseObject;
            }
            return null;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:13,代码来源:ServiceManagementCmdletTestHelper.cs

示例11: 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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例12: 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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例13: 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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:14,代码来源:ServiceManagementCmdletTestHelper.cs

示例14: 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;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServiceManagementCmdletTestHelper.cs

示例15: GetAzureVNetSite

        public Collection<VirtualNetworkSiteContext> GetAzureVNetSite(string vnetName)
        {
            GetAzureVNetSiteCmdletInfo getAzureVNetSiteCmdletInfo = new GetAzureVNetSiteCmdletInfo(vnetName);
            WindowsAzurePowershellCmdlet azurePowershellCmdlet = new WindowsAzurePowershellCmdlet(getAzureVNetSiteCmdletInfo);
            Collection<PSObject> result = azurePowershellCmdlet.Run();

            Collection<VirtualNetworkSiteContext> connections = new Collection<VirtualNetworkSiteContext>();
            foreach (PSObject re in result)
            {
                connections.Add((VirtualNetworkSiteContext)re.BaseObject);
            }
            return connections;
        }
开发者ID:huangpf,项目名称:azure-sdk-tools,代码行数:13,代码来源:ServiceManagementCmdletTestHelper.cs


注:本文中的WindowsAzurePowershellCmdlet.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。