Repro step:
Update-Database -Verbose
Result:
It shows the following message: Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Expectation:
When Update-Database has something to show other than the information message such as SQL statements, this is fine, but when it has nothing to update, and it has not much messages to show, the information message could give users a wrong impression that the verbose is not working.
Comments: The problem here is that we pass $Verbose.IsPresent to the update database command, but $Verbose does not provide the value of the -Verbose option. In fact, it seems that it may not be possible without some ugly hacks to know whether or not -Verbose has been set: see http://stackoverflow.com/questions/2775357/how-does-a-cmdlet-know-when-it-really-should-call-writeverbose
Update-Database -Verbose
Result:
It shows the following message: Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Expectation:
When Update-Database has something to show other than the information message such as SQL statements, this is fine, but when it has nothing to update, and it has not much messages to show, the information message could give users a wrong impression that the verbose is not working.
Comments: The problem here is that we pass $Verbose.IsPresent to the update database command, but $Verbose does not provide the value of the -Verbose option. In fact, it seems that it may not be possible without some ugly hacks to know whether or not -Verbose has been set: see http://stackoverflow.com/questions/2775357/how-does-a-cmdlet-know-when-it-really-should-call-writeverbose