如果我跑,如果文件夾不存在Erroraction不能與多個命令
Remove-Item .\somefolder -force -Recurse -erroraction 'silentlycontinue'
什麼都不會被顯示的工作,但如果我跑
Remove-Item .\somefolder -force -Recurse -erroraction 'silentlycontinue'; otherCommand
我得到「Remove- Item:找不到路徑'路徑',因爲它不存在。「
如何抑制錯誤?
編輯:我發現問題只發生在我從Visual Studio包管理器控制檯運行命令時。
你能解釋更多嗎?什麼是其他命令,因爲我測試了它。這是完整的工作沒有錯誤 – saftargholi
@arashzgh你是對的,我編輯我的問題 – user764754
我寫答案,它的工作很好只是把你的路徑在「./path」在雙嬰兒牀 – saftargholi