Reputation: 213
I am using Microsoft Visual Studio 2008 Visual Basic, and am creating a custom PowerShell Cmdlet.
How do I detect if either the -Verbose
or -Debug
parameters are used?
I have tried If Debug.IsPresent Then
, but that does not appear to work.
Upvotes: 1
Views: 218
Reputation: 43595
It is not VB.Net, but here is a solution in C# which should translate to VB.Net with ease
Upvotes: 0
Reputation:
You have to examine the parameters that are passed into the cmdlet. Use the $PSBoundParameters
automatic variable to determine which parameters were specified.
For more information, see: Get-Help -Name about_Automatic_Variables;
Upvotes: 1