remy: rename-FsItem should check last error to ensure rename op was ok
Closed this issue · 1 comments
plastikfan commented
Needs to check last error after invoking renam-item, because it can fail, eg if a renamed directory is open in another application and therefore locked, the rename operation will fail. Currently, rename-FsItem does not check the last error code and assumes the rename proceeds without error and returns $null implicily via a call to Get-Item on the intended destination path.
The last error description can be accessed via $error[0] and an Exception needs to be thrown that includes the error denoted in $error[0].
If the folder is currently open in another app, like an explorer, the error will be access denied.
plastikfan commented
Oh damn it, I raised this issue in the wrong repo, should be in RexFs.