How to move files to another folder using variables...escape strings
<p>I am trying to move files from one folder to a newly created folder. When I write to the host the file and folder names are correct but the file does not move. Here is the part of the code I am having trouble with. Obviously this doesn't move the files but I have tried almost every variation trying to escape the strings. </p>

<pre><code>$fileToMove= "$($path)\$($Event.SourceEventArgs.Name)"
Write-Host "File to move: $($fileToMove)"
$folder = New-Item -ItemType Directory -Path "$(split-path $Event.SourceEventArgs.FullPath)\$((Get-Date).ToString('yyyy'))\$((Get-Date).ToString('MMM yyyy'))\$((Get-Date).ToString('MMM d yyyy'))"
Write-Host "Folder name:$($folder)"
Move-Item '$($path)' '$($folder)'
</code></pre>