Skip to content

Commit

Permalink
Use built-in windows powershell if available
Browse files Browse the repository at this point in the history
This lowers the bar on Windows since PS is built-in there.
  • Loading branch information
kzu committed Jul 22, 2024
1 parent 631b10f commit 35d8715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion samples/dotnet/SponsorLink.Analyzer.targets
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ partial class SponsorLink
</Target>

<Target Name="DownloadDevloopedJwk" BeforeTargets="GetAssemblyAttributes" Inputs="$(MSBuildProjectFullPath)" Outputs="$(MSBuildProjectDirectory)\$(BaseIntermediateOutputPath)devlooped.jwk">
<Exec Command="pwsh -nop -f $(MSBuildThisFileDirectory)jwk.ps1" ConsoleToMSBuild="true" EchoOff="true">
<PropertyGroup>
<PwshCmd Condition="'$(OS)' == 'Windows_NT'">powershell</PwshCmd>
<PwshCmd Condition="'$(OS)' != 'Windows_NT'">pwsh</PwshCmd>
</PropertyGroup>
<Exec Command="$(PwshCmd) -nop -f $(MSBuildThisFileDirectory)jwk.ps1" ConsoleToMSBuild="true" EchoOff="true">
<Output TaskParameter="ConsoleOutput" PropertyName="RawJwk"/>
<Output TaskParameter="ExitCode" PropertyName="MSBuildLastExitCode" />
</Exec>
Expand Down
2 changes: 1 addition & 1 deletion samples/dotnet/jwk.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
curl https://raw.githubusercontent.com/devlooped/.github/main/sponsorlink.jwt --silent | jq -R 'split(".") | .[1] | @base64d | fromjson' | jq '.sub_jwk'
Invoke-RestMethod https://raw.githubusercontent.com/devlooped/.github/main/sponsorlink.jwt | jq -R 'split(".") | .[1] | @base64d | fromjson' | jq '.sub_jwk'

0 comments on commit 35d8715

Please sign in to comment.