I have a power shell script that I want to run with MSBuild. The script itself works and I can pass the path variables in with the command line; however, when I attempt to pass the variables in through MSbuild I get errors in the path.
 <?xml version="1.0" encoding="utf-8" ?>
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="C:\Program Files (x86)\MSBuild\PowershellTask\Powershell.targets"/>
   <Target Name="Minify">
   <PropertyGroup>
       <FilePath>\Scripts</FilePath>
       <OutputPath>\MinifiedJS</OutputPath>
   </PropertyGroup>
   <Exec Command= "powershell.exe -command "&.\MinifyCSS.ps1'$(FilePath)''$(OutputPath)'}"" />
How to I pass the path into MSBuild. The above code errors on /Scripts and /MinifiedJS. Here is the error:
powershell.exe -command "&{.\MinifyCSS.ps1'/Scripts''/MinifiedJS'}" The term '.\MinifyCSS.ps1/Scripts'/MinifiedJS' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:41 + &{.\MinifyCSS.ps1'/Scripts''/MinifiedJS' <<<< } + CategoryInfo : ObjectNotFound: (.\MinifyCSS.ps1/Scripts'/MinifiedJS:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
I also tried place them in quotes and using .\ prior.
Any Suggestions?
.\with the actual path to the script. I think the powershell.exe command is creating a new session, that is starting at the default path, not the current path, so.\MinifyCSS.ps1doesn't exist from the path powershell.exe is starting from.