title: How do I rename/move items and override even if they exist (for both files, folders and links)?
body: <p>Is there <strong><em>one command</em></strong> to move items (or just rename as both source and destination are in one folder) with forcing overwrite that does work for any item types (leaf, container)?</p>
  
  <p>Background: I am writing a script that replaces all hardlinks and junctions with respective relative symlinks. Sample code:</p>
  
  <pre><code>mkdir C:\Temp\foo -ErrorAction SilentlyContinue
  'example' &gt; C:\Temp\foo\bar.txt
  cd C:\Temp
  New-Item -ItemType Junction -Name bar -Target C:\Temp\foo
  New-Item -ItemType SymbolicLink -Name bar2 -Target '.\foo'
  
  # Produces error: Rename-Item : Cannot create a file when that file already exists.
  Rename-Item -Path 'C:\Temp\bar2' -newName 'bar' -force
  
  # Unexpected behaviour: moves bar2 inside bar
  Move-item -Path 'C:\Temp\bar2' -destination 'C:\Temp\bar' -force
  
  # This works as per https://github.com/PowerShell/PowerShell/issues/621
  [IO.Directory]::Delete('C:\Temp\bar')
  Rename-Item -Path 'C:\Temp\bar2' -newName 'bar'
  </code></pre>