问题
If I wanted to alter the behaviour of every cmdlet in a Powershell session to pass verbose flag I could achieve this in Powershell v3 with $PSDefaultParameterValues like so
$PSDefaultParameterValues['*:Verbose'] = $true
What would be a possible workaround for Powershell v2?
回答1:
No, this is a 'new' feature in PowerShell 3.0 and up: about_Parameters_Default_Values
来源:https://stackoverflow.com/questions/28808908/alter-behaviour-of-every-cmdlet-in-powershell-session-to-pass-verbose-flag