I am trying to execute the following post build event code but I am getting an non-useful error :
"c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -file "$(SolutionDir)tools\nuget_pack.ps1"
I have run the following PS script before I try :
Set-ExecutionPolicy unrestricted
What am I missing?
UPDATE
This is strange, I am not getting an error on VS now. but the script is not working. When I run it with powershell console I get the following error :

You can reproduce the error in Powershell as follows:
It is taking the first as a string, the
-fileas the-fformat flag and saying it doesn’t have a value expression on the right for the format substitution.Try like this:
& “c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe” -file “$(SolutionDir)tools\nuget_pack.ps1”(as Keith notes, this will not work as this is run from a bat file than Powershell.)
Or just: