From 7140dad5bbfc8ef19cd75dfb6f8fdda709b65f30 Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Sun, 8 Jan 2023 17:54:35 +0300 Subject: [PATCH] Create cloc.ps1 --- Scripts/cloc.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Scripts/cloc.ps1 diff --git a/Scripts/cloc.ps1 b/Scripts/cloc.ps1 new file mode 100644 index 00000000..62309426 --- /dev/null +++ b/Scripts/cloc.ps1 @@ -0,0 +1,16 @@ +# Download cloc +# https://github.com/AlDanial/cloc + +$Parameters = @{ + Uri = "https://api.github.com/repos/AlDanial/cloc/releases/latest" + UseBasicParsing = $true + Verbose = $true +} +$Tag = (Invoke-RestMethod @Parameters).tag_name.replace("v", "") +$Parameters = @{ + Uri = "https://github.com/AlDanial/cloc/releases/download/v$Tag/cloc-$Tag.exe" + OutFile = "$PSScriptRoot\cloc.exe" + UseBasicParsing = $true + Verbose = $true +} +Invoke-WebRequest @Parameters