title: Remove MSMQ storage limits with powershell
body: <p>How do I remove storage limits (queue quota) on specific queues with powershell? </p>
  
  <p>To <em>set</em> storage limits to some value with powershell, we can use the <code>Set-MsmqQueue</code> cmdlet:</p>
  
  <pre class="lang-bsh prettyprint-override"><code>Get-MsmqQueue myQueue | Set-MsmqQueue -QueueQuota  50000
  </code></pre>
  
  <p>To <em>remove</em> the setting I have tried </p>
  
  <pre class="lang-bsh prettyprint-override"><code>... | Set-MsmqQueue -QueueQuota $false # (does nothing)
  ... | Set-MsmqQueue -QueueQuota 0 # (does nothing)
  ... | Set-MsmqQueue -QueueQuota -1 # (fails; queue quota must be positive integer)
  ... | Set-MsmqQueue -QueueQuota ([System.Int32]::MaxValue) # (successfully sets quota to 2147483647)
  ... | Set-MsmqQueue -QueueQuota ([System.Int64]::MaxValue) # (fails; Invalid value 9223372036854775807 for property MaximumQueueSize.)
  </code></pre>
  
  <p>The <a href="https://docs.microsoft.com/en-us/powershell/module/msmq/set-msmqqueue" rel="nofollow noreferrer">powershell documentation</a> does not specify how to accomplish this. Does anyone know how to do this?</p>