【发布时间】:2021-10-22 13:02:19
【问题描述】:
在 Powershell 脚本中使用公共参数 -Whatif,例如:
Remove-Item -Path "$now\$basename" -Recurse -Whatif -Force |
Write-Entry -Line $(get-linenumber) -level 'Info' |
Create-Log -title "$title.log" -display
即使我可以清楚地看到屏幕上的文本,日志文件也是空白的。我想将 -Whatif 字符串传递给文本文件。我知道这与重定向有关,但据我所知。
【问题讨论】:
标签: powershell logging