Get-PartnerInvoiceStatement - Cannot access a closed Stream
See original GitHub issueThis used to work last month but no longer does.
I tested with old modules, new modules, and on three different computers. All return the same error for all invoices. So the command is basically broken at this point.
Steps to reproduce
$InvoiceId = Get-PartnerInvoice | Select-Object -Property InvoiceId -First 1
Get-PartnerInvoiceStatement -InvoiceId $InvoiceId.InvoiceId -OutputPath $Destination -Overwrite
Expected behavior
Download of PDF
Actual behavior
$InvoiceId = Get-PartnerInvoice | Select-Object -Property InvoiceId -First 1
Get-PartnerInvoiceStatement -InvoiceId $InvoiceId.InvoiceId -OutputPath $Destination -Overwrite
Get-PartnerInvoiceStatement : Cannot access a closed Stream.
At line:1 char:1
+ Get-PartnerInvoiceStatement -InvoiceId $InvoiceId.InvoiceId -OutputPa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-PartnerInvoiceStatement], ObjectDisposedException
+ FullyQualifiedErrorId : System.ObjectDisposedException,Microsoft.Store.PartnerCenter.PowerShell.Commands.GetPartnerInvoiceStatement
Then it produces an empty pdf file with the name of the invoice…
Module
Get-Module -Name PartnerCenter
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 1.5.1904.2 PartnerCenter {Add-PartnerCustomerCartLineItem, Add-PartnerCustomerUserRoleMember, Connect-PartnerCenter, Disconnect-PartnerCenter...}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
MemoryStream - Cannot access a closed Stream
Hi why using (var sw = new StreamWriter(ms)) returns Cannot access a closed Stream exception . Memory Stream is on top of this...
Read more >Cannot access a closed Stream when running this ...
System.ObjectDisposedException: Cannot access a closed Stream when running this statement MemoryStream stream = (MemoryStream)data.GetData( ...
Read more >Cannot access a closed Stream
Then I Want Make a XmlDocument Using MemoryStream. But I Have Following a Error Message: "Cannot access a closed Stream".
Read more >System.ObjectDisposedException: Cannot access a closed ...
Following our migration to cosmos SDK v3 and usage of feed range API, we started to see this exception occasionally in our traces:....
Read more >C# – getting “Cannot access a closed Stream” here
The problem is that the stream is closed (via Dispose() ) at the end of the using block. You retain a reference to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @cblackuk,
The required code changes have been merged, and this issue will be addressed in the next release. Right now I do not know the exact date when this release will be available through the PowerShell gallery. My hope is have it available before the end of the month.
It works now! Thanks @isaiahwilliams!