title: How do you support PowerShell's -WhatIf & -Confirm parameters in a Cmdlet that calls other Cmdlets?
body: <p>I have a PowerShell script cmdlet that supports the <code>-WhatIf</code> &amp; <code>-Confirm</code> parameters.  </p>
  
  <p>It does this by calling the <code>$PSCmdlet.ShouldProcess()</code> method before performing the change.<br>
  This works as expected.  </p>
  
  <p>The problem I have is that my Cmdlet is implemented by calling other Cmdlets and the <code>-WhatIf</code> or <code>-Confirm</code> parameters are not passed along to the Cmdlets I invoke.</p>
  
  <p>How can I pass along the values of <code>-WhatIf</code> and <code>-Confirm</code> to the Cmdlets I call from my Cmdlet?</p>
  
  <p>For example, if my Cmdlet is <code>Stop-CompanyXyzServices</code> and it uses <code>Stop-Service</code> to implement its action.  </p>
  
  <p>If <code>-WhatIf</code> is passed to <code>Stop-CompanyXyzServices</code> I want it to also be passed to Stop-Service.  </p>
  
  <p>Is this possible?</p>