Skip to content

Commit

Permalink
Run powershell command according to platform (OfficeDev#46)
Browse files Browse the repository at this point in the history
* Run powershell command according to platform

This checks the OS and either runs powershell.exe or pwsh. Note that if pwsh isn't installed, the user will have to install it. For MacOS that's `brew install --cask powershell`

Hat tip to @SteveL-MSFT for the `Condition` suggestion.

* Update samples/app-hello-world/csharp/Microsoft.Teams.Samples.HelloWorld.Web/Microsoft.Teams.Samples.HelloWorld.Web.csproj

Co-authored-by: Steve Lee <[email protected]>

Co-authored-by: Steve Lee <[email protected]>
  • Loading branch information
haacked and SteveL-MSFT authored Oct 13, 2022
1 parent 3f31108 commit 121b373
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe Compress-Archive -Path \&quot;$(ProjectDir)Manifest\*\&quot; -DestinationPath \&quot;$(TargetDir)helloworldapp.zip\&quot; -Force" />
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="powershell.exe Compress-Archive -Path \&quot;$(ProjectDir)Manifest\*\&quot; -DestinationPath \&quot;$(TargetDir)helloworldapp.zip\&quot; -Force" />
<Exec Condition="'$(OS)' == 'Unix'" Command="pwsh -Command Compress-Archive -Path &quot;$(ProjectDir)Manifest/*&quot; -DestinationPath &quot;$(TargetDir)helloworldapp.zip&quot; -Force" />
</Target>

</Project>

0 comments on commit 121b373

Please sign in to comment.