Remove-Item で確認が出る。
例えば、Powershellでレジストリを消そうとすると。
レジストリの削除
Remove-Item -LiteralPath 'HKLM:\SOFTWARE\Classes\Directory\background\shell\VSCode'
確認が表示される。
If you continue, all children will be removed with the item. Are you sure you want to continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
確認無しで削除を実行
確認が表示されると自動化に困難なので、確認を出さない
Remove-Item -LiteralPath 'HKLM:\SOFTWARE\Classes\Directory\background\shell\VSCode' -Confirm:$false -Recurse -Force
コレで、確認無しで削除を実行できる。
-confirm:$false
で「無」確認で実行できる。
Bashなどのスクリプトにある「常にYESと答える。」、PowerShellは、Bashとは違い、「はじめから確認なし」になる。
参考資料
https://stackoverflow.com/questions/4753702/automatic-confirmation-of-deletion-in-powershell