{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-powershell/issues/5938","repository_url":"https://api.github.com/repos/Azure/azure-powershell","labels_url":"https://api.github.com/repos/Azure/azure-powershell/issues/5938/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-powershell/issues/5938/comments","events_url":"https://api.github.com/repos/Azure/azure-powershell/issues/5938/events","html_url":"https://github.com/Azure/azure-powershell/issues/5938","id":313820642,"number":5938,"title":"[NetCore 0.11.0] AzureRM.NetCore\\Get-AzureRMResource -ResourceId without APIVersion fails","user":{"login":"raghushantha","id":11727200,"avatar_url":"https://avatars0.githubusercontent.com/u/11727200?v=4","gravatar_id":"","url":"https://api.github.com/users/raghushantha","html_url":"https://github.com/raghushantha","followers_url":"https://api.github.com/users/raghushantha/followers","following_url":"https://api.github.com/users/raghushantha/following{/other_user}","gists_url":"https://api.github.com/users/raghushantha/gists{/gist_id}","starred_url":"https://api.github.com/users/raghushantha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raghushantha/subscriptions","organizations_url":"https://api.github.com/users/raghushantha/orgs","repos_url":"https://api.github.com/users/raghushantha/repos","events_url":"https://api.github.com/users/raghushantha/events{/privacy}","received_events_url":"https://api.github.com/users/raghushantha/received_events","type":"User","site_admin":false},"labels":[{"id":387211104,"url":"https://api.github.com/repos/Azure/azure-powershell/labels/NetCore","name":"NetCore","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"MiYanni","id":17788297,"avatar_url":"https://avatars1.githubusercontent.com/u/17788297?v=4","gravatar_id":"","url":"https://api.github.com/users/MiYanni","html_url":"https://github.com/MiYanni","followers_url":"https://api.github.com/users/MiYanni/followers","following_url":"https://api.github.com/users/MiYanni/following{/other_user}","gists_url":"https://api.github.com/users/MiYanni/gists{/gist_id}","starred_url":"https://api.github.com/users/MiYanni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiYanni/subscriptions","organizations_url":"https://api.github.com/users/MiYanni/orgs","repos_url":"https://api.github.com/users/MiYanni/repos","events_url":"https://api.github.com/users/MiYanni/events{/privacy}","received_events_url":"https://api.github.com/users/MiYanni/received_events","type":"User","site_admin":false},"assignees":[{"login":"MiYanni","id":17788297,"avatar_url":"https://avatars1.githubusercontent.com/u/17788297?v=4","gravatar_id":"","url":"https://api.github.com/users/MiYanni","html_url":"https://github.com/MiYanni","followers_url":"https://api.github.com/users/MiYanni/followers","following_url":"https://api.github.com/users/MiYanni/following{/other_user}","gists_url":"https://api.github.com/users/MiYanni/gists{/gist_id}","starred_url":"https://api.github.com/users/MiYanni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiYanni/subscriptions","organizations_url":"https://api.github.com/users/MiYanni/orgs","repos_url":"https://api.github.com/users/MiYanni/repos","events_url":"https://api.github.com/users/MiYanni/events{/privacy}","received_events_url":"https://api.github.com/users/MiYanni/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Azure/azure-powershell/milestones/48","html_url":"https://github.com/Azure/azure-powershell/milestone/48","labels_url":"https://api.github.com/repos/Azure/azure-powershell/milestones/48/labels","id":3315446,"number":48,"title":"Internal Only - NetStandard 0.12","description":"Milestone for next release of NetStandard cmdlets\r\n\r\nCode Complete 5/11;  Shipping 5/15","creator":{"login":"markcowl","id":1054056,"avatar_url":"https://avatars1.githubusercontent.com/u/1054056?v=4","gravatar_id":"","url":"https://api.github.com/users/markcowl","html_url":"https://github.com/markcowl","followers_url":"https://api.github.com/users/markcowl/followers","following_url":"https://api.github.com/users/markcowl/following{/other_user}","gists_url":"https://api.github.com/users/markcowl/gists{/gist_id}","starred_url":"https://api.github.com/users/markcowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markcowl/subscriptions","organizations_url":"https://api.github.com/users/markcowl/orgs","repos_url":"https://api.github.com/users/markcowl/repos","events_url":"https://api.github.com/users/markcowl/events{/privacy}","received_events_url":"https://api.github.com/users/markcowl/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":5,"state":"open","created_at":"2018-05-02T17:11:51Z","updated_at":"2018-05-23T20:31:53Z","due_on":"2018-05-11T07:00:00Z","closed_at":null},"comments":2,"created_at":"2018-04-12T17:30:35Z","updated_at":"2018-05-25T12:54:59Z","closed_at":null,"author_association":"NONE","body":"### Description\r\n\r\n[NetCore 0.11.0] AzureRM.NetCore\\Get-AzureRMResource -ResourceId without APIVersion fails\r\n\r\n### Script/Steps for Reproduction\r\n\r\n<!-- Please provide the necessary script(s) that reproduce the issue -->\r\n\r\n```powershell\r\nImport-Module -Name AzureRM.NetCore\r\nGet-Module -Name AzureRM.NetCore | fl -f\r\n\r\nName              : AzureRM.NetCore\r\nPath              : C:\\Program Files\\PowerShell\\Modules\\AzureRM.NetCore\\0.11.0\\AzureRM.Netcore.psm1\r\nDescription       : [PowerShell .Net Core] Azure Resource Manager Module\r\nModuleType        : Script\r\nVersion           : 0.11.0\r\n\r\n$DebugPreference = 'Continue'\r\nGet-AzureRmResource -ResourceId \"subscriptions/$subId/resourceGroups\"\r\nDEBUG: 5:21:51 PM - GetAzureResourceCmdlet begin processing with ParameterSet 'GetByResourceId'.\r\nDEBUG: 5:21:51 PM - using account id '========================'...\r\nGet-AzureRmResource : One or more errors occurred. (The type initializer for 'ApiVersionCache' threw an exception.)\r\nAt line:1 char:1\r\n+ Get-AzureRmResource -ResourceId \"subscriptions/$subId/resourceGroups\"\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo          : NotSpecified: (:) [Get-AzureRmResource], AggregateException\r\n+ FullyQualifiedErrorId : System.AggregateException,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet\r\n\r\n# Using APIVersion explicitly works fine\r\n Get-AzureRmResource -ResourceId \"subscriptions/$subId/resourceGroups\" -ApiVersion 2018-02-01\r\n<works>\r\n```\r\n\r\n### Module Version\r\n\r\n```powershell\r\nGet-Module -Name AzureRM.NetCore -ListAvailable\r\n\r\n\r\n    Directory: C:\\Program Files\\PowerShell\\Modules\r\n\r\n\r\nModuleType Version    Name                                ExportedCommands\r\n---------- -------    ----                                ----------------\r\nScript     0.11.0     AzureRM.Netcore\r\nManifest   0.10.0     AzureRM.Netcore\r\n```\r\n\r\n### Environment Data\r\n\r\n```powershell\r\n$PSVersionTable\r\n\r\nName                           Value\r\n----                           -----\r\nPSVersion                      6.1.0-preview.1\r\nPSEdition                      Core\r\nGitCommitId                    v6.1.0-preview.1\r\nOS                             Microsoft Windows 10.0.14393\r\nPlatform                       Win32NT\r\nPSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion      2.3\r\nSerializationVersion           1.1.0.1\r\nWSManStackVersion              3.0\r\n```\r\n\r\n### Debug Output\r\n\r\n```powershell\r\n$DebugPreference = 'Continue'\r\n$subId = <your subscription Id after auth to Azure>\r\nGet-AzureRmResource -ResourceId \"subscriptions/$subId/resourceGroups\"\r\nDEBUG: 5:21:51 PM - GetAzureResourceCmdlet begin processing with ParameterSet 'GetByResourceId'.\r\nDEBUG: 5:21:51 PM - using account id '========================'...\r\nGet-AzureRmResource : One or more errors occurred. (The type initializer for 'ApiVersionCache' threw an exception.)\r\nAt line:1 char:1\r\n+ Get-AzureRmResource -ResourceId \"subscriptions/$subId/resourceGroups\"\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n+ CategoryInfo          : NotSpecified: (:) [Get-AzureRmResource], AggregateException\r\n+ FullyQualifiedErrorId : System.AggregateException,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/Azure/azure-powershell/issues/comments/392049122","html_url":"https://github.com/Azure/azure-powershell/issues/5938#issuecomment-392049122","issue_url":"https://api.github.com/repos/Azure/azure-powershell/issues/5938","id":392049122,"user":{"login":"mosharafMS","id":23546820,"avatar_url":"https://avatars1.githubusercontent.com/u/23546820?v=4","gravatar_id":"","url":"https://api.github.com/users/mosharafMS","html_url":"https://github.com/mosharafMS","followers_url":"https://api.github.com/users/mosharafMS/followers","following_url":"https://api.github.com/users/mosharafMS/following{/other_user}","gists_url":"https://api.github.com/users/mosharafMS/gists{/gist_id}","starred_url":"https://api.github.com/users/mosharafMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mosharafMS/subscriptions","organizations_url":"https://api.github.com/users/mosharafMS/orgs","repos_url":"https://api.github.com/users/mosharafMS/repos","events_url":"https://api.github.com/users/mosharafMS/events{/privacy}","received_events_url":"https://api.github.com/users/mosharafMS/received_events","type":"User","site_admin":false},"created_at":"2018-05-25T12:54:59Z","updated_at":"2018-05-25T12:54:59Z","author_association":"NONE","body":"\r\nI got the same issue on this code snippet on this line\r\n`$nicObject=Get-AzureRmResource -ResourceId $vmNic.id | Get-AzureRmNetworkInterface `\r\n\r\nThe same script is working on the PS desktop module but doesn't work on core module. \r\nDo we have a timeline for the fix to be released? \r\n\r\n```\r\n$vmNICs=$vm.NetworkProfile.NetworkInterfaces \r\nforeach($vmNic in $vmNICs)\r\n{\r\n    $nicObject=Get-AzureRmResource -ResourceId $vmNic.id | Get-AzureRmNetworkInterface \r\n    $ipconfigs=$nicObject.IpConfigurations\r\n    $NSG=$nicObject.NetworkSecurityGroup\r\n    Remove-AzureRmNetworkInterface -Name $nicObject.Name -ResourceGroupName $ResourceGroupName -Force\r\n    Remove-AzureRmResource -ResourceId $ipconfigs.PublicIpAddress.Id -Force \r\n    Remove-AzureRmResource -ResourceId $NSG.Id -Force \r\n}\r\n```"}}
{"actor":{"display_login":"mosharafMS"}}