Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure RM&;Powershell(服务名称)_Powershell_Azure_Azure Resource Manager - Fatal编程技术网

Azure RM&;Powershell(服务名称)

Azure RM&;Powershell(服务名称),powershell,azure,azure-resource-manager,Powershell,Azure,Azure Resource Manager,我已经在AzureRM中编写了一个脚本来配置VM,现在我需要访问VM并添加端点,使用如下所示 $VMLocalAdminUser = $DeployCredentials.Username $VMLocalAdminSecurePassword = ConvertTo-SecureString $deployCredentials.Password -AsPlainText -Force $Credential = New-Object System.Management

我已经在AzureRM中编写了一个脚本来配置VM,现在我需要访问VM并添加端点,使用如下所示

    $VMLocalAdminUser = $DeployCredentials.Username
    $VMLocalAdminSecurePassword = ConvertTo-SecureString $deployCredentials.Password -AsPlainText -Force
    $Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);
新AzureRmVm

-ResourceGroupName$hostMachine.ResourceGroup
-名称$($machine.VirtualMachineName)

-ImageName$($image.ImageName)
-位置$hostMachine.Location` -凭证$凭证

  $vm = Get-AzureRMVM -ServiceName "" -Name $machine.VirtualMachineName

  $vm | Add-AzureEndpoint -Name "File Sharing 1" -Protocol "tcp" -PublicPort ###-LocalPort ###
  $vm | Add-AzureEndpoint -Name "File Sharing 2" -Protocol "tcp" -PublicPort ### -LocalPort ### 
  $vm | Add-AzureEndpoint -Name "RemoteDesktop" -Protocol "tcp" -PublicPort #### -LocalPort #### 
我现在正试图弄清楚我是如何在AzureRM中实现这一点的,主要问题是ServiceName是什么,在哪里以及如何找到它以将其添加到上面的内容中


提前谢谢

Get-AzureRMVM不应要求microsoft提供以下服务名称