locked
how to give message not helpmessage in $credential heading in params RRS feed

  • General discussion

  • I want to assign message in credential declaration on very start of cmdlet

    for example

    param{

    [validationNullorEmpty]

    [param(mandatory=true, helpmessage="Enter Domain spec cred")]

    $credential=[pscredential]::Empty

    }

    instead of helpmessage I want to add below Message

    if ($credential -ne $null){$credential=Get-credential -Message "Add domain cred"}

    because when I define function have no $credential then default window it show me the message "enter the credential" that I don't want I want my message "Add domain cred"

    Actually this message will appear after first default window, so instead of get-credential default window I want to custom my window with my message, how to do that, instead of help message can I declare -Message in  [param(mandatory=true, -Message="Enter Domain spec cred")] like this

     

     
    Monday, April 22, 2019 2:52 PM

All replies