logo
  • 教程列表
  • SO官方文档
  • 使用 ShouldProcess
    • 完整用法示例
    • 添加 -WhatIf 和 -Confirm 对 cmdlet 的支持
    • 使用带有一个参数的 ShouldProcess()
  1. StackOverflow 文档
  2. PowerShell 教程
  3. 使用 ShouldProcess

使用 ShouldProcess

Created: November-22, 2018

$PSCmdlet.ShouldProcess() 还会自动将消息写入详细输出。

PS> Invoke-MyCmdlet -Verbose
VERBOSE: Performing the operation "Invoke-MyCmdlet" on target "Target of action"
  • 完整用法示例

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明