Alter behaviour of every cmdlet in Powershell session to pass verbose flag

跟風遠走 提交于 2020-01-14 19:15:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!