Powershell apply verbosity at a global level

放肆的年华 提交于 2019-12-03 06:29:54

Use $PSDefaultParameterValues:

$PSDefaultParameterValues['New-Item:Verbose'] = $true

Set that in the Global scope, and then the default value of -Verbose for the New-Item cmdlet will be $True.

You can use wildcards for the cmdletsyou want to affect:

$PSDefaultParameterValues['New-*:Verbose'] = $true

Will set it for all New-* cmdlets.

$PSDefaultParameterValues['*:Verbose'] = $true

will set it for all cmdlets.

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