As far as I remember: $PSBoundParameters is just shortcut for $MyInvocation.BoundParameters:
$MyInvocation.BoundParameters.Equals($PSBoundParameters)
True
If you want to get the same information in cmdlet that you wrote, you can get it like that...:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;
namespace Test
{
[Cmdlet(VerbsCommon.Get, "WhatIf", SupportsShouldProcess = true)]
public class GetWhatIf : PSCmdlet
{
// Methods
protected override void BeginProcessing()
{
this.WriteObject(this.MyInvocation.BoundParameters.ContainsKey("WhatIf").ToString());
}
}
}
The code is quick'n'dirty, but you should get the picture. Disclaimer: I'm not a developer, so I'm probably doing it wrong. ;)
HTH
Bartek