Source
- use
-ErrorAction Ignore(return code will be success), or-ErrorAction SilentlyContinue(return code will be failure, but not error be raised)
Remove-Item <Path> -ErrorAction IgnoreSource
-ErrorAction Ignore (return code will be success), or -ErrorAction SilentlyContinue (return code will be failure, but not error be raised)Remove-Item <Path> -ErrorAction Ignore