header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Subject: Switches in script cmdlets?
Prev Next
You are not authorized to post a reply.

Author Messages
c_shanklinUser is Offline
New Member
New Member
Posts:1

07/18/2008 10:04 PM  

Does anyone know how to do switches in script cmdlets? What I want is to have a parameter called monolithic that is a boolean, and if you call the cmdlet with -monolithic, the value is set to true, otherwise to false.

The closest I've gotten to this is using: [bool]$Monolithic=0 in the parameter set.

The problem with that is that if I call the cmdlet with -monolithic, PowerShell complains that I need to supply a boolean argument. If I leave off the [bool] part at the front, PowerShell complains that I need to supply a System.Object.

Anyone know how to do this?

Thanks,

glnsizeUser is Offline
Shell Enthusiast
Shell Enthusiast
Posts:60

07/19/2008 5:37 AM  

[switch]$monolithic


~Glenn

You are not authorized to post a reply.
Forums > Using PowerShell > General PowerShell > Switches in script cmdlets?



ActiveForums 3.7
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer