Azure / Azure/azure-powershell

Bad Error Message For Get-AzVMImage

Open
#12,630 6 comments 0 reactions 1 assignee Claimed by @nikhilmhatre View on GitHub
Azure Stack bug Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

## Description

When the requested VM images don't exist, it gives a very vague error. Keep in mind that I used the Az modules that works with AzureStack. To install these modules enter this command:

Install-Module -Name Az -Repository PSGallery -RequiredVersion 0.10.0-preview -AllowPrerelease -Force

## Steps to reproduce

Simply run Get-AzVMImage on an image that doesn't exist.

```powershell
PS C:\Users\Administrator> Get-AzVMImage -Location local -PublisherName Canonical -Offer UbuntuServer -Sku 16.04-LTS
Get-AzVMImage : Object reference not set to an instance of an object.
At line:1 char:1
+ Get-AzVMImage -Location local -PublisherName Canonical -Offer UbuntuS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVMImage], NullReferenceException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.GetAzureVMImageCommand
```

## Environment data

```
PS C:\Users\Administrator> $PSVersionTable

Name Value
---- -----
PSVersion 5.1.17763.10184
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.10184
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

## Module versions

```powershell
PS C:\Users\Administrator> Get-Module -ListAvailable

Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 5.2.7.2 ADAL.PS {Clear-AdalTokenCache, Get-AdalAuthenticationContext, Get-AdalToken, New-AdalClientCredential...}
Script 1.0 AS.Certificate {GetCertificate, CreatePSDrive, ImportPfxCertificate, ExportCertificate}
Script 1.0 AS.DumpOnLargeHost
Script 1.0 AS.Group
Script 1.0 AS.Impersonation
Script 1.0 AS.Netlogon
Script 1.0 AS.Service {GetUserNameAndPassword, CompareByteArray, ValidateStartupType, SetLogOnAsServicePolicy...}
Script 1.0 AS.ServicePrincipalName
Script 1.0 AS.TimeServer
Script 1.0 AS.WMIConfiguration
Script 1.0 AS.WSMan
Manifest 1.1.0.0 AS.xAdcsDeployment
Manifest 1.17.0.0 AS.xWebAdministration
Script 2.0.1 Az.Accounts {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave...}
Script 0.10.0 Az.Billing Get-UsageAggregates
Script 0.10.0 Az.Compute {Remove-AzAvailabilitySet, Get-AzAvailabilitySet, New-AzAvailabilitySet, Update-AzAvailabilitySet...}
Script 1.1.0 Az.DataBoxEdge {Get-AzDataBoxEdgeJob, Get-AzDataBoxEdgeDevice, Invoke-AzDataBoxEdgeDevice, New-AzDataBoxEdgeDevice...}
Script 0.10.0 Az.Dns {Get-AzDnsRecordSet, New-AzDnsRecordConfig, Remove-AzDnsRecordSet, Set-AzDnsRecordSet...}
Script 1.4.3 Az.EventHub {New-AzEventHubNamespace, Get-AzEventHubNamespace, Set-AzEventHubNamespace, Remove-AzEventHubNamespace...}
Script 0.10.0 Az.IotHub {Add-AzIotHubKey, Get-AzIotHubEventHubConsumerGroup, Get-AzIotHubConnectionString, Get-AzIotHubJob...}
Script 0.10.0 Az.KeyVault {Add-AzKeyVaultCertificate, Set-AzKeyVaultCertificateAttribute, Stop-AzKeyVaultCertificateOperation, Get-AzKeyVaultCe...
Script 1.6.0 Az.Monitor {Get-AzMetricDefinition, Get-AzMetric, Remove-AzLogProfile, Get-AzLogProfile...}
Script 0.10.0 Az.Network {Add-AzApplicationGatewayAuthenticationCertificate, Get-AzApplicationGatewayAuthenticationCertificate, New-AzApplicat...
Script 0.10.0 Az.Resources {Get-AzProviderOperation, Remove-AzRoleAssignment, Get-AzRoleAssignment, New-AzRoleAssignment...}
Script 0.10.0 Az.Storage {Get-AzStorageTableStoredAccessPolicy, Get-AzStorageTable, New-AzStorageTableSASToken, New-AzStorageTableStoredAccess...
Script 0.10.0 Az.Websites {Get-AzAppServicePlan, Set-AzAppServicePlan, New-AzAppServicePlan, Remove-AzAppServicePlan...}
Script 0.9.0 Azs.Azurebridge.Admin {Get-AzsAzureBridgeActivation, Get-AzsAzureBridgeDownloadedProduct, Get-AzsAzureBridgeProduct, Invoke-AzsAzureBridgeP...
Script 0.9.0 Azs.Backup.Admin {Get-AzsBackup, Get-AzsBackupConfiguration, Restore-AzsBackup, Set-AzsBackupConfiguration...}
Script 0.9.0 Azs.Commerce.Admin Get-AzsSubscriberUsage
Script 0.9.0 Azs.Compute.Admin {Add-AzsPlatformImage, Add-AzsVMExtension, Get-AzsComputeQuota, Get-AzsDisk...}
Script 0.9.0 Azs.Deployment.Admin {New-AzsProductPackage, Invoke-AzsResourceManager, New-AzsFileContainer, Get-AzsResourceManagerAccessToken...}
Script 0.9.0 Azs.Fabric.Admin {Add-AzsScaleUnitNode, Disable-AzsScaleUnitNode, Enable-AzsScaleUnitNode, Get-AzsDrive...}
Script 0.9.0 Azs.Gallery.Admin {Add-AzsGalleryItem, Get-AzsGalleryItem, Remove-AzsGalleryItem}
Script 0.9.0 Azs.Infrastructureinsights.Admin {Close-AzsAlert, Get-AzsAlert, Get-AzsRegionHealth, Get-AzsRegistrationHealth...}
Script 0.9.0 Azs.Keyvault.Admin Get-AzsKeyvaultQuota
Script 0.9.0 Azs.Network.Admin {Get-AzsLoadBalancer, Get-AzsNetworkAdminOverview, Get-AzsNetworkQuota, Get-AzsPublicIPAddress...}
Script 0.9.0 Azs.Storage.Admin {Get-AzsStorageAccount, Get-AzsStorageAcquisition, Get-AzsStorageQuota, Get-AzsStorageSettings...}
Script 0.9.0 Azs.Subscriptions {Get-AzsDelegatedProviderOffer, Get-AzsOffer, Get-AzsSubscription, New-AzsSubscription...}
Script 0.9.0 Azs.Subscriptions.Admin {Add-AzsPlanToOffer, Get-AzsAcquiredPlan, Get-AzsAdminManagedOffer, Get-AzsDelegatedProvider...}
Script 0.9.0 Azs.Update.Admin {Get-AzsUpdate, Get-AzsUpdateLocation, Get-AzsUpdateRun, Install-AzsUpdate...}
Script 2.0.0 AzureStack
Manifest 1.0 CloudCommon {Wait-Result, New-ExecutionContextXmlForNode, Enable-AutoLogon, New-Credential...}
Script 1.0 DSC.ACS.ACSServices
Script 1.0 DSC.ACS.Blob
Script 1.0 DSC.ACS.Common {Add-ServiceAccountPrivilege, Get-ServiceAccountPrivilege}
Script 1.0 DSC.ACS.Settings {Test-SecureStringEqual, Get-IndicatorFilePath, New-SettingsManager}
Script 1.0 DSC.CertHelpers GetSubjectName
Script 1.0 DSC.ExternalDNS {Start-DnsLogging, Stop-DnsLogging, Append-Dot, Retry-ScriptBlock}
Script 1.0 DSC.HealthAgent
Script 1.0 DSC.MonitoringAgent
Script 1.0 DSC.NetworkController NoFunction
Script 1.0 DSC.ProcessorPowerManagement
Script 1.0 DSC.ServiceWithFailureAction
Script 1.0 DSC.Storage
Script 1.0 DSC.TraceCollector
Script 0.0 HostAgentRestart Restart-HostAgents
Script 0.0 HostUpdate {Copy-CustomizedVHDToHost, Remove-OldHostVHD, Stop-LocalVMs}
Script 0.0 HyperVLogging SetHyperVLogging
Script 1.0 JustEnoughAdministration
Binary 2.7 Microsoft.AzureStack.Diagnostics {Get-ASAggregate, Get-ASHotPath, Get-ASTimeLapse, Get-ASChildEvent...}
Script 1.0 Microsoft.AzureStack.Diagnostics... {Get-AzureStackLog, Invoke-AzureStackOnDemandLog, Get-AzureStackLogs}
Script 1.0 Microsoft.AzureStack.Diagnostics... {Get-ServiceFabricStandaloneLog, Get-AzureStackAlert, Get-DiagnosticsRegistrations, Get-MetricAccountRegistrations}
Script 1.1 Microsoft.AzureStack.Diagnostics... Test-AzureStack
Script 0.0 Microsoft.AzureStack.Fabric.Comp... {Get-CpiClusterEmptyAvailabilitySets, ShutDown-CpiClusterNode, Get-CpiClusterResourcePrivateProperty, Set-CpiClusterR...
Script 0.0 Microsoft.AzureStack.Fabric.Comp... {Set-CpiVmTempDisk, Set-CpiVmProcessorReservePercent, Set-CpiVmProcessorThreadCount, Set-CpiVmComPort...}
Binary 1.2005.0.0 Microsoft.AzureStack.Fabric.Comp... {Get-HostPackage, Install-HostPackage, Uninstall-HostPackage}
Manifest 1.0.0.0 Microsoft.AzureStack.Fabric.Stor... {Get-SCStorageSystem, Get-SCVirtualDisk, Get-SCFileShare, Get-SCVolume...}
Script 0.0 Microsoft.AzureStack.GPWmiFilter {New-GPWmiFilter, Get-GPWmiFilter, Remove-GPWmiFilter, Set-GPWmiFilter...}
Binary 2.2004.0.0 Microsoft.AzureStack.OOBManagement {Get-IpmiDeviceUserId, Set-IpmiDeviceUsernamePassword, Set-IpmiDeviceOneTimePxeBoot, Restart-IpmiDevice...}
Manifest 1.0 Microsoft.AzureStack.PrivilegedE... {Get-SupportSessionInfo, Get-SupportSessionToken, Unlock-SupportSession, Get-RecoverySessionToken...}
Script 1.0.1 Microsoft.PowerShell.Operation.V... {Get-OperationValidation, Invoke-OperationValidation}
Script 1.0 NET.Tracing
Script 0.0 NetworkControllerRESTWrappers {New-NCGreTunnel, New-NCVirtualSubnet, New-NCL3Tunnel, Remove-NCServer...}
Script 0.0 NewManagementVM {Remove-NCAccessControlList, Remove-NCSwitch, Remove-NCCredential, New-NCVirtualSubnet...}
Script 1.4.7 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource...}
Manifest 1.0.0.0 PDT.DSC.HyperV
Manifest 1.0.0.0 PDT.DSC.Networking {Convert-CIDRToSubhetMask, Test-IsNanoServer, New-InvalidOperationException, Get-LocalizedData...}
Manifest 1.0.0.0 PDT.DSC.Service
Script 1.0.0.0 PDT.DSC.Utilities
Script 1.0 PDT_MigrationProtocol
Script 3.4.0 Pester {Describe, Context, It, Should...}
Script 2.2.1 PowerShellGet {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability...}
Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, Save-Module, Update-Module...}
Script 1.1.13 PrivateCloud.DiagnosticInfo {Get-SddcDiagnosticInfo, Show-SddcDiagnosticReport, Show-SddcDiagnosticStorageLatencyReport, Install-SddcDiagnosticMo...
Script 2.0.0 PSReadline {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler, Get-PSReadLineOption...}
Script 0.0 Shutdown Stop-LocalPhysicalComputer
Script 0.0 StorageSubsystem Get-VolumesFromStorageSubsystem
Manifest 2.0.0.0 xSmbShare

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.1.0 ActiveDirectory {Add-ADCentralAccessPolicyMember, Add-ADComputerServiceAccount, Add-ADDomainControllerPasswordReplicationPolicy, Add-...
Manifest 1.0.0.0 ADDSDeployment {Add-ADDSReadOnlyDomainControllerAccount, Install-ADDSForest, Install-ADDSDomain, Install-ADDSDomainController...}
Manifest 1.0.0.0 AppBackgroundTask {Disable-AppBackgroundTaskDiagnosticLog, Enable-AppBackgroundTaskDiagnosticLog, Set-AppBackgroundTaskResourcePolicy, ...
Manifest 2.0.0.0 AppLocker {Get-AppLockerFileInformation, Get-AppLockerPolicy, New-AppLockerPolicy, Set-AppLockerPolicy...}
Manifest 1.0.0.0 AppvClient {Add-AppvClientConnectionGroup, Add-AppvClientPackage, Add-AppvPublishingServer, Disable-Appv...}
Manifest 2.0.1.0 Appx {Add-AppxPackage, Get-AppxPackage, Get-AppxPackageManifest, Remove-AppxPackage...}
Manifest 1.0 BestPractices {Get-BpaModel, Get-BpaResult, Invoke-BpaModel, Set-BpaResult}
Manifest 1.0.0.0 BitLocker {Unlock-BitLocker, Suspend-BitLocker, Resume-BitLocker, Remove-BitLockerKeyProtector...}
Manifest 2.0.0.0 BitsTransfer {Add-BitsFile, Complete-BitsTransfer, Get-BitsTransfer, Remove-BitsTransfer...}
Manifest 1.0.0.0 BranchCache {Add-BCDataCacheExtension, Clear-BCCache, Disable-BC, Disable-BCDowngrading...}
Manifest 1.0.0.0 CimCmdlets {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession...}
Binary 2.0.0.0 ClusterAwareUpdating {Get-CauPlugin, Register-CauPlugin, Unregister-CauPlugin, Invoke-CauScan...}
Manifest 1.0 ConfigCI {Get-SystemDriver, New-CIPolicyRule, New-CIPolicy, Get-CIPolicy...}
Manifest 2.0.0.0 DcbQos {Get-NetQosFlowControl, Set-NetQosFlowControl, Enable-NetQosFlowControl, Disable-NetQosFlowControl...}
Manifest 1.0 Defender {Get-MpPreference, Set-MpPreference, Add-MpPreference, Remove-MpPreference...}
Manifest 1.0.1.0 DeliveryOptimization {Get-DeliveryOptimizationStatus, Get-DeliveryOptimizationPerfSnap, Get-DeliveryOptimizationLog, Get-DOConfig...}
Manifest 1.0 DFSN {Get-DfsnRoot, Remove-DfsnRoot, Set-DfsnRoot, New-DfsnRoot...}
Binary 2.0.0.0 DFSR {New-DfsReplicationGroup, Get-DfsReplicationGroup, Set-DfsReplicationGroup, Remove-DfsReplicationGroup...}
Manifest 1.0.0.0 DirectAccessClientComponents {Disable-DAManualEntryPointSelection, Enable-DAManualEntryPointSelection, Get-DAClientExperienceConfiguration, Get-DA...
Script 3.0 Dism {Add-AppxProvisionedPackage, Add-WindowsDriver, Add-WindowsCapability, Add-WindowsImage...}
Manifest 1.0.0.0 DnsClient {Resolve-DnsName, Clear-DnsClientCache, Get-DnsClient, Get-DnsClientCache...}
Manifest 2.0.0.0 DnsServer {Add-DnsServerConditionalForwarderZone, Add-DnsServerDirectoryPartition, Add-DnsServerForwarder, Add-DnsServerPrimary...
Manifest 1.0.0.0 EventTracingManagement {Start-EtwTraceSession, New-EtwTraceSession, Get-EtwTraceSession, Update-EtwTraceSession...}
Manifest 2.0.0.0 FailoverClusters {Add-ClusterCheckpoint, Add-ClusterDisk, Add-ClusterFileServerRole, Add-ClusterGenericApplicationRole...}
Manifest 1.0 FailoverClusterSet {Get-ClusterSetLog, Add-ClusterSetFaultDomainMember, Add-ClusterSetMember, Add-ClusterSetMemberTag...}
Manifest 1.0.0.0 Gatewaytunnel {Set-GatewayTunnel, Get-GatewayTunnel, Remove-GatewayTunnel, Connect-GatewayTunnel...}
Manifest 1.0.0.0 GroupPolicy {Backup-GPO, Block-GPInheritance, Copy-GPO, Get-GPInheritance...}
Manifest 1.0.0.0 HgsClient {Get-HgsAttestationBaselinePolicy, Get-HgsClientConfiguration, Test-HgsClientConfiguration, Set-HgsClientConfiguratio...
Manifest 1.0.0.0 HgsDiagnostics {New-HgsTraceTarget, Get-HgsTrace, Get-HgsTraceFileData, Test-HgsTraceTarget}
Manifest 1.0.0.0 HNVDiagnostics {Get-CustomerRoute, Get-PACAMapping, Get-ProviderAddress, Test-VirtualNetworkConnection...}
Binary 2.0.0.0 Hyper-V {Add-VMAssignableDevice, Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMGpuPartitionAdapter...}
Binary 1.1 Hyper-V {Add-VMDvdDrive, Add-VMFibreChannelHba, Add-VMHardDiskDrive, Add-VMMigrationNetwork...}
Script 1.1.0.0 IISAdministration {Get-IISAppPool, Start-IISCommitDelay, Stop-IISCommitDelay, Get-IISSite...}
Manifest 2.0.0.0 International {Get-WinDefaultInputMethodOverride, Set-WinDefaultInputMethodOverride, Get-WinHomeLocation, Set-WinHomeLocation...}
Manifest 1.0.0.0 iSCSI {Get-IscsiTargetPortal, New-IscsiTargetPortal, Remove-IscsiTargetPortal, Update-IscsiTargetPortal...}
Manifest 2.0.0.0 IscsiTarget {Add-ClusteriSCSITargetServerRole, Add-IscsiVirtualDiskTargetMapping, Checkpoint-IscsiVirtualDisk, Convert-IscsiVirtu...
Script 1.0.0.0 ISE {New-IseSnippet, Import-IseSnippet, Get-IseSnippet}
Manifest 1.0.0.0 Kds {Add-KdsRootKey, Get-KdsRootKey, Test-KdsRootKey, Set-KdsConfiguration...}

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\JEAModules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.0.0 Microsoft.AzureStack.Fabric.Stor... {Get-SCStorageSystem, Get-SCVirtualDisk, Get-SCFileShare, Get-SCVolume...}

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 1.0.1.0 Microsoft.PowerShell.Archive {Compress-Archive, Expand-Archive}
Manifest 3.0.0.0 Microsoft.PowerShell.Diagnostics {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter...}
Manifest 3.0.0.0 Microsoft.PowerShell.Host {Start-Transcript, Stop-Transcript}
Manifest 1.0.0.0 Microsoft.PowerShell.LocalAccounts {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup...}
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path...}
Script 1.0 Microsoft.PowerShell.ODataUtils Export-ODataEndpointProxy
Manifest 3.0.0.0 Microsoft.PowerShell.Security {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential...}
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Format-List, Format-Custom, Format-Table, Format-Wide...}
Manifest 3.0.0.0 Microsoft.WSMan.Management {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuickConfig...}
Manifest 1.0 MMAgent {Disable-MMAgent, Enable-MMAgent, Set-MMAgent, Get-MMAgent...}
Manifest 1.0.0.0 MsDtc {New-DtcDiagnosticTransaction, Complete-DtcDiagnosticTransaction, Join-DtcDiagnosticResourceManager, Receive-DtcDiagn...
Manifest 2.0.0.0 NetAdapter {Disable-NetAdapter, Disable-NetAdapterBinding, Disable-NetAdapterChecksumOffload, Disable-NetAdapterEncapsulatedPack...
Manifest 1.0.0.0 NetConnection {Get-NetConnectionProfile, Set-NetConnectionProfile}
Manifest 1.0.0.0 NetDiagnostics Get-NetView
Manifest 1.0.0.0 NetEventPacketCapture {New-NetEventSession, Remove-NetEventSession, Get-NetEventSession, Set-NetEventSession...}
Manifest 2.0.0.0 NetLbfo {Add-NetLbfoTeamMember, Add-NetLbfoTeamNic, Get-NetLbfoTeam, Get-NetLbfoTeamMember...}
Manifest 1.0.0.0 NetNat {Get-NetNat, Get-NetNatExternalAddress, Get-NetNatStaticMapping, Get-NetNatSession...}
Manifest 2.0.0.0 NetQos {Get-NetQosPolicy, Set-NetQosPolicy, Remove-NetQosPolicy, New-NetQosPolicy}
Manifest 2.0.0.0 NetSecurity {Get-DAPolicyChange, New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoProposal, New-NetIPsecQuickModeCryptoProposa...
Manifest 1.0.0.0 NetSwitchTeam {New-NetSwitchTeam, Remove-NetSwitchTeam, Get-NetSwitchTeam, Rename-NetSwitchTeam...}
Manifest 1.0.0.0 NetTCPIP {Get-NetIPAddress, Get-NetIPInterface, Get-NetIPv4Protocol, Get-NetIPv6Protocol...}
Manifest 1.0.0.0 NetWNV {Get-NetVirtualizationProviderAddress, Get-NetVirtualizationGlobal, Get-NetVirtualizationLookupRecord, Get-NetVirtual...
Manifest 1.0.0.0 NetworkConnectivityStatus {Get-DAConnectionStatus, Get-NCSIPolicyConfiguration, Reset-NCSIPolicyConfiguration, Set-NCSIPolicyConfiguration}
Manifest 1.0.0.0 NetworkSwitchManager {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEthernetPort, Get-NetworkSwitchEthernetPort, Remove-NetworkSw...
Manifest 1.0.0.0 NetworkTransition {Add-NetIPHttpsCertBinding, Disable-NetDnsTransitionConfiguration, Disable-NetIPHttpsProfile, Disable-NetNatTransitio...
Manifest 1.0 NFS {Get-NfsMappedIdentity, Get-NfsNetgroup, Install-NfsMappingStore, New-NfsMappedIdentity...}
Manifest 1.0.0.0 Nps {Export-NpsConfiguration, Get-NpsRadiusClient, Get-NpsSharedSecretTemplate, Import-NpsConfiguration...}
Manifest 1.0.0.0 PcsvDevice {Get-PcsvDevice, Start-PcsvDevice, Stop-PcsvDevice, Restart-PcsvDevice...}
Binary 1.0.0.0 PersistentMemory {Get-PmemDisk, Get-PmemPhysicalDevice, Get-PmemUnusedRegion, New-PmemDisk...}
Manifest 1.0.0.0 PKI {Add-CertificateEnrollmentPolicyServer, Export-Certificate, Export-PfxCertificate, Get-CertificateAutoEnrollmentPolic...
Manifest 1.0.0.0 PlatformIdentifier Get-PlatformIdentifier
Manifest 1.0.0.0 PnpDevice {Get-PnpDevice, Get-PnpDeviceProperty, Enable-PnpDevice, Disable-PnpDevice}
Manifest 1.1 PrintManagement {Add-Printer, Add-PrinterDriver, Add-PrinterPort, Get-PrintConfiguration...}
Binary 1.0.11 ProcessMitigations {Get-ProcessMitigation, Set-ProcessMitigation, ConvertTo-ProcessMitigationPolicy}
Manifest 1.1 PSDesiredStateConfiguration {Set-DscLocalConfigurationManager, Start-DscConfiguration, Test-DscConfiguration, Publish-DscConfiguration...}
Script 1.0.0.0 PSDiagnostics {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace...}
Binary 1.1.0.0 PSScheduledJob {New-JobTrigger, Add-JobTrigger, Remove-JobTrigger, Get-JobTrigger...}
Manifest 2.0.0.0 PSWorkflow {New-PSWorkflowExecutionOption, New-PSWorkflowSession, nwsn}
Manifest 1.0.0.0 PSWorkflowUtility Invoke-AsWorkflow
Manifest 3.0.0.0 RemoteAccess {Add-DAAppServer, Add-DAClient, Add-DAClientDnsConfiguration, Add-DAEntryPoint...}
Manifest 2.0.0.0 RemoteDesktop {Get-RDCertificate, Set-RDCertificate, New-RDCertificate, New-RDVirtualDesktopDeployment...}
Manifest 1.0.0.0 ScheduledTasks {Get-ScheduledTask, Set-ScheduledTask, Register-ScheduledTask, Unregister-ScheduledTask...}
Manifest 2.0.0.0 SecureBoot {Confirm-SecureBootUEFI, Set-SecureBootUEFI, Get-SecureBootUEFI, Format-SecureBootUEFI...}
Manifest 1.0.0.0 SecurityCmdlets {Backup-SecurityPolicy, Restore-SecurityPolicy, Backup-AuditPolicy, Restore-AuditPolicy}
Script 1.0.0.0 ServerCore {Get-DisplayResolution, Set-DisplayResolution}
Script 2.0.0.0 ServerManager {Get-WindowsFeature, Install-WindowsFeature, Uninstall-WindowsFeature, Enable-ServerManagerStandardUserRemoting...}
Cim 1.0.0.0 ServerManagerTasks {Get-SMCounterSample, Get-SMPerformanceCollector, Start-SMPerformanceCollector, Stop-SMPerformanceCollector...}
Manifest 2.0.0.0 SmbShare {Get-SmbShare, Remove-SmbShare, Set-SmbShare, Block-SmbShareAccess...}
Manifest 2.0.0.0 SmbWitness {Get-SmbWitnessClient, Move-SmbWitnessClient, gsmbw, msmbw...}
Manifest 2.0.0.0 SoftwareInventoryLogging {Get-SilComputer, Get-SilComputerIdentity, Get-SilSoftware, Get-SilWindowsUpdate...}
Manifest 1.0.0.0 StartLayout {Export-StartLayout, Import-StartLayout, Export-StartLayoutEdgeAssets, Get-StartApps}
Manifest 2.0.0.0 Storage {Add-InitiatorIdToMaskingSet, Add-PartitionAccessPath, Add-PhysicalDisk, Add-StorageFaultDomain...}
Manifest 1.0.0.0 StorageBusCache {Clear-StorageBusDisk, Disable-StorageBusCache, Disable-StorageBusDisk, Enable-StorageBusCache...}
Manifest 1.0.0.0 StorageQoS {Get-StorageQoSPolicy, Get-StorageQoSPolicyStore, Set-StorageQoSPolicyStore, Remove-StorageQoSPolicy...}
Manifest 2.0.0.0 TLS {New-TlsSessionTicketKey, Enable-TlsSessionTicketKey, Disable-TlsSessionTicketKey, Export-TlsSessionTicketKey...}
Manifest 1.0.0.0 TroubleshootingPack {Get-TroubleshootingPack, Invoke-TroubleshootingPack}
Manifest 2.0.0.0 TrustedPlatformModule {Get-Tpm, Initialize-Tpm, Clear-Tpm, Unblock-Tpm...}
Binary 2.1.639.0 UEV {Clear-UevConfiguration, Clear-UevAppxPackage, Restore-UevBackup, Set-UevTemplateProfile...}
Manifest 2.0.0.0 UpdateServices {Add-WsusComputer, Approve-WsusUpdate, Deny-WsusUpdate, Get-WsusClassification...}
Manifest 1.0.0.0 UserAccessLogging {Enable-Ual, Disable-Ual, Get-Ual, Get-UalDns...}
Manifest 2.0.0.0 VpnClient {Add-VpnConnection, Set-VpnConnection, Remove-VpnConnection, Get-VpnConnection...}
Manifest 1.0.0.0 Wdac {Get-OdbcDriver, Set-OdbcDriver, Get-OdbcDsn, Add-OdbcDsn...}
Manifest 1.0.0.0 WebAdministration {Start-WebCommitDelay, Stop-WebCommitDelay, Get-WebConfigurationLock, Remove-WebConfigurationLock...}
Manifest 2.0.0.0 Whea {Get-WheaMemoryPolicy, Set-WheaMemoryPolicy}
Manifest 1.0.0.0 WindowsDeveloperLicense {Get-WindowsDeveloperLicense, Unregister-WindowsDeveloperLicense, Show-WindowsDeveloperLicenseRegistration}
Script 1.0 WindowsErrorReporting {Enable-WindowsErrorReporting, Disable-WindowsErrorReporting, Get-WindowsErrorReporting}
Manifest 1.0.0.0 WindowsSearch {Get-WindowsSearchSetting, Set-WindowsSearchSetting}
Manifest 1.0.0.0 WindowsUpdate Get-WindowsUpdateLog
Manifest 1.0.0.2 WindowsUpdateProvider {Get-WUAVersion, Get-WULastInstallationDate, Get-WULastScanSuccessDate, Get-WUIsPendingReboot...}
```

## Debug output

```
PS C:\Users\Administrator> $DebugPreference='Continue'

PS C:\Users\Administrator> Get-AzVMImage -Location local -PublisherName Canonical -Offer UbuntuServer -Sku 16.04-LTS
DEBUG: 6:01:54 PM - GetAzureVMImageCommand begin processing with ParameterSet 'ListVMImage'.
DEBUG: 6:01:54 PM - using account id 'ciserviceadmin@msazurestack.onmicrosoft.com'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'ciserviceadmin@msazurestack.onmicrosoft.com', environment: 'AzStackAdmin', tenant: 'd9b782d5-d098-4374-8f2c-3907cc34
611c'
DEBUG: [SilentAuthenticator] Creating IPublicClientApplication - ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', Authority: 'https://login.microsoftonline.com/d9b782d5-d098-4374
-8f2c-3907cc34611c', UseAdfs: 'False'
DEBUG: [SilentAuthenticator] Calling GetAccountsAsync
DEBUG: [SilentAuthenticator] Calling AcquireTokenSilent - Scopes: 'https://adminmanagement.azurestackci11.onmicrosoft.com/8c9dd6da-2a28-4e03-8a77-ed312c0adef7/.default', UserId: '
ciserviceadmin@msazurestack.onmicrosoft.com', Number of accounts: '1'
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) MSAL MSAL.CoreCLR with assembly ve
rsion '4.10.0.0'. CorrelationId(e389cf1b-552e-4797-a9ab-eca617e61474)
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) === OnBehalfOfParameters ===
LoginHint provided: False
User provided: True
ForceRefresh: False

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0)
=== Request Data ===
Authority Provided? - True
Scopes - https://adminmanagement.azurestackci11.onmicrosoft.com/8c9dd6da-2a28-4e03-8a77-ed312c0adef7/.default
Extra Query Params Keys (space separated) -

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentReque
st) started:

Authority Host: login.microsoftonline.com
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Looking up access token in the cac
he.
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Filtering by tenant id item count
before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Filtering by home account id item
count before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Filtering by token type item count
before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Matching entry count - 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Filtering by scopes item count bef
ore 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Access token is not expired. Retur
ning the found cache entry. [Current time (08/11/2020 01:01:54) - Expiration Time (08/11/2020 01:55:53 +00:00) - Extended Expiration Time (08/11/2020 01:55:53 +00:00)]
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) Returning access token found in ca
che. RefreshOn exists ? False
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - e389cf1b-552e-4797-a9ab-eca617e61474] (UnknownClient: 0.0.0.0) === Token Acquisition finished suc
cessfully. An access token was returned with Expiration Time: 08/11/2020 01:55:53 +00:00 ===
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'd9b782d5-d098-4374-8f2c-3907cc34611c', UserId: 'ciserviceadmin@msazurestack.onmicrosoft.com'
DEBUG: [Common.Authentication]: Authenticating using Account: 'ciserviceadmin@msazurestack.onmicrosoft.com', environment: 'AzStackAdmin', tenant: 'd9b782d5-d098-4374-8f2c-3907cc34
611c'
DEBUG: [SilentAuthenticator] Creating IPublicClientApplication - ClientId: '1950a258-227b-4e31-a9cf-717495945fc2', Authority: 'https://login.microsoftonline.com/d9b782d5-d098-4374
-8f2c-3907cc34611c', UseAdfs: 'False'
DEBUG: [SilentAuthenticator] Calling GetAccountsAsync
DEBUG: [SilentAuthenticator] Calling AcquireTokenSilent - Scopes: 'https://adminmanagement.azurestackci11.onmicrosoft.com/8c9dd6da-2a28-4e03-8a77-ed312c0adef7/.default', UserId: '
ciserviceadmin@msazurestack.onmicrosoft.com', Number of accounts: '1'
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) MSAL MSAL.CoreCLR with assembly ve
rsion '4.10.0.0'. CorrelationId(794e769a-c777-4025-bcbf-3d5c80c8e60f)
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) === OnBehalfOfParameters ===
LoginHint provided: False
User provided: True
ForceRefresh: False

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0)
=== Request Data ===
Authority Provided? - True
Scopes - https://adminmanagement.azurestackci11.onmicrosoft.com/8c9dd6da-2a28-4e03-8a77-ed312c0adef7/.default
Extra Query Params Keys (space separated) -

DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) === Token Acquisition (SilentReque
st) started:

Authority Host: login.microsoftonline.com
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Looking up access token in the cac
he.
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Filtering by tenant id item count
before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Filtering by home account id item
count before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Filtering by token type item count
before 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Matching entry count - 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Filtering by scopes item count bef
ore 1 after 1
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Access token is not expired. Retur
ning the found cache entry. [Current time (08/11/2020 01:01:54) - Expiration Time (08/11/2020 01:55:53 +00:00) - Extended Expiration Time (08/11/2020 01:55:53 +00:00)]
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) Returning access token found in ca
che. RefreshOn exists ? False
DEBUG: [MSAL] Info: (False) MSAL 4.10.0.0 MSAL.CoreCLR N/A [08/11/2020 01:01:54 - 794e769a-c777-4025-bcbf-3d5c80c8e60f] (UnknownClient: 0.0.0.0) === Token Acquisition finished suc
cessfully. An access token was returned with Expiration Time: 08/11/2020 01:55:53 +00:00 ===
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: 'd9b782d5-d098-4374-8f2c-3907cc34611c', UserId: 'ciserviceadmin@msazurestack.onmicrosoft.com'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://adminmanagement.local.azurestack.external/subscriptions/00d6ef38-2492-4565-8fe4-ce1581cc6ba7/providers/Microsoft.Compute/locations/local/publishers/Canonical/artifacttypes
/vmimage/offers/UbuntuServer/skus/16.04-LTS/versions?api-version=2017-12-01

Headers:
x-ms-client-request-id : ba1b3595-3eae-4d5d-bbd1-3aeee3e3c05f
accept-language : en-US

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NotFound

Headers:
Pragma : no-cache
x-ms-correlation-request-id : 79657b42-c841-4d9d-9bcd-e1a5bf29e01b
x-ms-ratelimit-remaining-subscription-reads: 14723
x-ms-request-id : 79657b42-c841-4d9d-9bcd-e1a5bf29e01b
x-ms-routing-request-id : LOCAL:20200811T010154Z:79657b42-c841-4d9d-9bcd-e1a5bf29e01b
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Cache-Control : no-cache
Date : Tue, 11 Aug 2020 01:01:54 GMT
Server : Microsoft-HTTPAPI/2.0
WWW-Authenticate : oYG3MIG0oAMKAQChCwYJKoZIgvcSAQICooGfBIGcYIGZBgkqhkiG9xIBAgICAG+BiTCBhqADAgEFoQMCAQ+iejB4oAMCARKicQRvMqQRED5JwpxEkB00Q+2nT/VKpEHMxZnXze1ap2QJIND9BR3
YgsfugEcFhoeXqQ+I9JXrMTobqQqyMWI3Uo4EuE4bg1/JiUQUHqviOWndmkujTvtqyHnOrqAzNocZFRLFFiI1Hd2C5UTntJ2EkV0G

Body:

DEBUG: 6:01:54 PM - GetAzureVMImageCommand end processing.
Get-AzVMImage : Object reference not set to an instance of an object.
At line:1 char:1
+ Get-AzVMImage -Location local -PublisherName Canonical -Offer UbuntuS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-AzVMImage], NullReferenceException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.GetAzureVMImageCommand

DEBUG: 6:01:54 PM - GetAzureVMImageCommand end processing.

PS C:\Users\Administrator>
```

## Error output

```
PS C:\Users\Administrator> Resolve-AzError -Error $Error[0]
DEBUG: 6:03:18 PM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
DEBUG: 6:03:18 PM - using account id 'ciserviceadmin@msazurestack.onmicrosoft.com'...
WARNING: Breaking changes in the cmdlet 'Resolve-AzError' :
WARNING: - The `Resolve-Error` alias will be removed in a future release. Please change any scripts that use this alias to use `Resolve-AzError` instead.

WARNING: NOTE : Go to https://aka.ms/azps-changewarnings for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell.

HistoryId: 7

Message : Object reference not set to an instance of an object.
StackTrace : at Microsoft.Azure.Commands.Compute.Common.ComputeCloudException.GetErrorMessageWithRequestIdInfo(CloudException cloudException)
at Microsoft.Azure.Commands.Compute.Common.ComputeCloudException..ctor(CloudException ex)
at Microsoft.Azure.Commands.Compute.ComputeClientBaseCmdlet.ExecuteClientAction(Action action)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : System.NullReferenceException
InvocationInfo : {Get-AzVMImage}
Line : Get-AzVMImage -Location local -PublisherName Canonical -Offer UbuntuServer -Sku 16.04-LTS
Position : At line:1 char:1
+ Get-AzVMImage -Location local -PublisherName Canonical -Offer UbuntuS ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 7

DEBUG: 6:03:18 PM - ResolveError end processing.

PS C:\Users\Administrator>
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.