Skip to content

Error: Exception setting "SecurityRules" #2

@ghost

Description

"Cannot convert the "System.Object[]" valu
e of type "System.Object[]" to type "Microsoft.Azure.Commands.Network.Models.PSSecurityRule"."

Went through this example got above error:
. .\Copy-AzNSGSecurityRules.ps1
PS C:> $nsg1 = Get-AzNetworkSecurityGroup -ResourceGroupName 'rg1' -Name 'nsg1'
PS C:> $nsg2 = Get-AzNetworkSecurityGroup -ResourceGroupName 'rg2' -Name 'nsg2'
PS C:> Copy-AzNSGSecurityRules -SourceNSG $nsg1 -TargetNSG $nsg2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions