@@ -80,6 +80,7 @@ protected AzureLongRunningJob(string command, string name) : base(command, name)
80
80
/// <typeparam name="T">The type of the cmdlet being executed</typeparam>
81
81
public class AzureLongRunningJob < T > : AzureLongRunningJob , ICommandRuntime where T : AzurePSCmdlet
82
82
{
83
+ const int MaxRecords = 1000 ;
83
84
string _status = "Running" ;
84
85
T _cmdlet ;
85
86
ICommandRuntime _runtime ;
@@ -671,7 +672,7 @@ public bool TransactionAvailable()
671
672
public void WriteCommandDetail ( string text )
672
673
{
673
674
ThrowIfJobFailedOrCancelled ( ) ;
674
- if ( Verbose . IsOpen )
675
+ if ( Verbose . IsOpen && Verbose . Count < MaxRecords )
675
676
{
676
677
Verbose . Add ( new VerboseRecord ( text ) ) ;
677
678
}
@@ -684,7 +685,7 @@ public void WriteCommandDetail(string text)
684
685
public void WriteDebug ( string text )
685
686
{
686
687
ThrowIfJobFailedOrCancelled ( ) ;
687
- if ( Debug . IsOpen )
688
+ if ( Debug . IsOpen && Debug . Count < MaxRecords )
688
689
{
689
690
Debug . Add ( new DebugRecord ( text ) ) ;
690
691
}
@@ -745,7 +746,7 @@ public void WriteObject(object sendToPipeline, bool enumerateCollection)
745
746
public void WriteProgress ( ProgressRecord progressRecord )
746
747
{
747
748
ThrowIfJobFailedOrCancelled ( ) ;
748
- if ( Progress . IsOpen )
749
+ if ( Progress . IsOpen && Progress . Count < MaxRecords )
749
750
{
750
751
Progress . Add ( progressRecord ) ;
751
752
}
@@ -769,7 +770,7 @@ public void WriteProgress(long sourceId, ProgressRecord progressRecord)
769
770
public void WriteVerbose ( string text )
770
771
{
771
772
ThrowIfJobFailedOrCancelled ( ) ;
772
- if ( Verbose . IsOpen )
773
+ if ( Verbose . IsOpen && Verbose . Count < MaxRecords )
773
774
{
774
775
Verbose . Add ( new VerboseRecord ( text ) ) ;
775
776
}
0 commit comments