Niranjan U
Niranjan U

Reputation: 195

Using Powershell to achive post build in VS based on assembly platform

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

Answers (3)

Alex
Alex

Reputation: 13229

Why not use Visual Studio's own custom build step? Seems odd to reinvent the wheel.

Upvotes: 2

Han
Han

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

Richard
Richard

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

Related Questions