In Command Prompt, I would use:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler -p "C:\Visual Studio 2013\myProjectFolder" -v /-u "C:\CompiledFilesFolder"
In Command Prompt, I would use:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler -p "C:\Visual Studio 2013\myProjectFolder" -v /-u "C:\CompiledFilesFolder"
Your code will also work in powershell. Here is a slightly improved way to do it:
$aspnetCompiler = (Join-Path $env:windir 'Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler')
& $aspnetCompiler -p "C:\Visual Studio 2013\myProjectFolder" -v /-u "C:\CompiledFilesFolder"