Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Get-PartnerInvoiceLineItem gives no Error Message #202

Closed
fjsebk opened this issue Nov 26, 2019 · 3 comments
Closed

Get-PartnerInvoiceLineItem gives no Error Message #202

fjsebk opened this issue Nov 26, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@fjsebk
Copy link

fjsebk commented Nov 26, 2019

The idea was to get the files and invoices provided through CSP via an API which I wanted to code. The problem here is that I get some but not all files and sometimes not even an errormessage.

Steps to reproduce

Connect-PartnerCenter
$path = "C:\tmp"
$d = Get-PartnerInvoice
$d | ForEach-Object {$ivid = $.InvoiceId
$pathname = $path + $
.InvoiceDate.Year + "" + $.InvoiceDate.Year + "" + $_.InvoiceDate.Month
$pathname2 = $pathname + "" + $ivid + " - Azure - Billing" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceStatement -InvoiceId $ivid -OutputPath $pathname -Overwrite
Get-PartnerInvoiceLineItem -BillingProvider Azure -InvoiceId $ivid -LineItemType BillingLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - Azure - Usage" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider Azure -InvoiceId $ivid -LineItemType UsageLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - Office - Billing" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider Office -InvoiceId $ivid -LineItemType BillingLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - Office - Usage" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider Office -InvoiceId $ivid -LineItemType UsageLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - OneTime - Billing" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider OneTime -InvoiceId $ivid -LineItemType BillingLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - OneTime - Usage" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider OneTime -InvoiceId $ivid -LineItemType UsageLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - Marketplace - Billing" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider Marketplace -InvoiceId $ivid -LineItemType BillingLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
$pathname2 = $pathname + "" + $ivid + " - Marketplace - Usage" + ".xlsx"
$pathname2
start-sleep 5
Get-PartnerInvoiceLineItem -BillingProvider Marketplace -InvoiceId $ivid -LineItemType UsageLineItems -CurrencyCode 'Euro' | Export-Excel $pathname2
Write-Host "-----------------"
start-sleep 5
}

Expected behavior

To get the files / data I needed

Actual behavior

It gives me errors that the 'Invoice Line Item type is not valid.' which is okay for me. But sometimes I get the following:
Get-PartnerInvoiceLineItem :
as you can see it states no error at all or even what's wrong with it. It doesn't matter if it is 'Office', 'OneTime' or something else, I get it on several statements with both (BillingLineItems and UsageLineItems). (The start-sleep-statements were added for debugging reasons and should not be the problem I think)

Environment

Script 2.0.1909.5 PartnerCenter {Add-PartnerCustomerCartLineItem, Add-PartnerCustomerUserRoleMember, Connect-PartnerCenter, Disconnect-PartnerCenter...}

Help is highly appreciated.

Best regards

@ghost
Copy link

ghost commented Dec 2, 2019

@fjsebk thank you for bring this information. With the upcoming release there have been a number of enhancements that will help address this issue. Also, diagnostic information is being added to each command so if an error is not returned you will be able to actually see the response from the API just by specifying the Debug parameter.

With all of this in mind the root cause for this particular issue should be addressed with the upcoming release.

@ghost ghost self-assigned this Dec 2, 2019
@ghost ghost added the bug Something isn't working label Dec 2, 2019
@ghost
Copy link

ghost commented Dec 6, 2019

@fjsebk version 3.0 has been released. It addresses a number of issues including this one. You can find complete details regarding the new release here. Please let us know if you have any other issues.

@ghost ghost closed this as completed Dec 6, 2019
@fjsebk
Copy link
Author

fjsebk commented Dec 10, 2019

I updated the module to version 3.0.0 and still have the same issue. Or does it not give me an errormessage because it is the same errormessage as the last or the first error?

Get-PartnerInvoiceLineItem : Invoice Line Item type is not valid.
At PATH\CSP1.ps1:44 char:1

  • Get-PartnerInvoiceLineItem -BillingProvider Office -InvoiceId $ivid - ...
  •   + CategoryInfo          : CloseError: (:) [Get-PartnerInvoiceLineItem], PartnerException
      + FullyQualifiedErrorId : Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerInvoiceLineItem
    
    

PATH2\INVOICEID - OneTime - Billing.xlsx
Get-PartnerInvoiceLineItem :
At PATH\CSP1.ps1:48 char:1

  • Get-PartnerInvoiceLineItem -BillingProvider OneTime -InvoiceId $ivid ...
  •   + CategoryInfo          : CloseError: (:) [Get-PartnerInvoiceLineItem], PartnerException
      + FullyQualifiedErrorId : Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerInvoiceLineItem
    
    

PATH2\INVOICEID - OneTime - Usage.xlsx
Get-PartnerInvoiceLineItem :
At PATH\CSP1.ps1:52 char:1

  • Get-PartnerInvoiceLineItem -BillingProvider OneTime -InvoiceId $ivid ...
  •   + CategoryInfo          : CloseError: (:) [Get-PartnerInvoiceLineItem], PartnerException
      + FullyQualifiedErrorId : Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerInvoiceLineItem
    
    

PATH2\INVOICEID - Marketplace - Billing.xlsx
Get-PartnerInvoiceLineItem :
At PATH\CSP1.ps1:56 char:1

  • Get-PartnerInvoiceLineItem -BillingProvider Marketplace -InvoiceId $i ...
  •   + CategoryInfo          : CloseError: (:) [Get-PartnerInvoiceLineItem], PartnerException
      + FullyQualifiedErrorId : Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerInvoiceLineItem
    
    

PATH2\INVOICEID - Marketplace - Usage.xlsx
Get-PartnerInvoiceLineItem : Invoice is not available.
At PATH\CSP1.ps1:60 char:1

  • Get-PartnerInvoiceLineItem -BillingProvider Marketplace -InvoiceId $i ...
  •   + CategoryInfo          : CloseError: (:) [Get-PartnerInvoiceLineItem], PartnerException
      + FullyQualifiedErrorId : Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerInvoiceLineItem
    
    
    

(PATH, INVOICEID and PATH2 was used to blank the data)

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant