powreshell 对话, 听到说特定词后执行命令, 截屏

install-module prelude

ipmo prelude
screenshot # 截屏
say '你好'
Invoke-ListenForWord -Triggers 'hello' -Actions { Write-Color 'Welcome' -Green }
Invoke-ListenForWord -Triggers 'hello', 'quit' -Actions { say 'Welcome' | Out-Null; $True }, { say 'Goodbye' | Out-Null; $False }
posted @ 2021-09-07 21:06  whiter001  阅读(32)  评论(0编辑  收藏  举报