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

  • 關於本站
  • 免責聲明