Get-AzureRmVirtualNetworkSubnetConfig Fails

Welcome Forums General PowerShell Q&A Get-AzureRmVirtualNetworkSubnetConfig Fails

This topic contains 3 replies, has 2 voices, and was last updated by

2 years, 2 months ago.

  • Author
  • #55861

    Points: 99
    Rank: Member

    Not sure why the Get-AzureRmVirtualNetworkSubnetConfig Fails, any help?

  • #55867

    Points: 99
    Rank: Member
  • #55877

    Points: 438
    Helping Hand
    Rank: Contributor

    The error:

    Get-AzureRmVirtualNetworkSubnetConfig : Cannot bind parameter 'VirtualNetwork'. Cannot convert the "VNET1" value of type "System.String" to type 

    indicates that the cmdlet is expecting a PSVirtualNetwork and not a String (e.g. VNET1). Try using Get-AzureRmVirtualNetwork to get the network prior calling Get-AzureRmVirtualNetworkSubnetConfig. Try something like this:

    Get-AzureRmVirtualNetwork -Name VNET1 | Get-AzureRmVirtualNetworkSubnetConfig
  • #55880

    Points: 99
    Rank: Member

    Tried that as well didnt work, somtimes it works and sometimes it doest, not sure why..

    PS C:\Windows\system32> Get-AzureRmVirtualNetwork -ResourceGroupName $resourceGroup|Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name Subnet02

    Get-AzureRmVirtualNetworkSubnetConfig : Cannot convert 'System.Object[]' to the type

    'Microsoft.Azure.Commands.Network.Models.PSVirtualNetwork' required by parameter
    'VirtualNetwork'. Specified method is not supported.
    At line:1 char:115
    + ... VirtualNetwork $vnet -Name Subnet02
    + ~~~~~
    + CategoryInfo : InvalidArgument: (:) [Get-AzureRmVirtualNetworkSubnetConfig], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Azure.Commands.Network.GetAzureVirtualNetworkSubnetConfigCommand

The topic ‘Get-AzureRmVirtualNetworkSubnetConfig Fails’ is closed to new replies.