Reputation: 195
I am trying to use Powershell to achive post build in Visual studio. I want to copy the appropriate dlls to the appropriate directories after the build based on the platform to which the assembly is targetted (i.e. x86 or x64). Does anyone know how to achieve this?
Upvotes: 0
Views: 550
Reputation: 13229
Why not use Visual Studio's own custom build step? Seems odd to reinvent the wheel.
Upvotes: 2
Reputation: 2037
You can use something like the following in the post-build event:
Powershell -File "$(SolutionDir)PostBuild.ps1" $(PlatformName)
The platform name can then be found in $args[0] inside the script (PostBuild.ps1).
Upvotes: 2
Reputation: 108975
You will need to explicitly launch PSH.
Something like
PowerShell -command &"commands go here"
Assuming (as is the default) PSH is in the user's path.
Upvotes: 0