-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
27 lines (18 loc) · 1.01 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env pwsh
$global:ProgressPreference = 'SilentlyContinue'
Set-Location -Path $PSScriptRoot
$WebClient = [System.Net.WebClient]::new()
$AWSPowerShellURL = 'https://sdk-for-net.amazonwebservices.com/ps/v4/latest/AWS.Tools.zip'
$DestinationPath = '{0}/AWS.Tools.zip' -f $PSScriptRoot
$WebClient.DownloadFile($AWSPowerShellURL, $DestinationPath)
# Extract the AWS PowerShell module
Expand-Archive -Path $DestinationPath -DestinationPath $env:PSModulePath.Split(':')[0]
# Clean up the module ZIP file
Remove-Item -Path $DestinationPath
# Determine the current version of the AWS PowerShell module
$ModuleVersion = (Get-Module -ListAvailable -Name AWS.Tools.Common).Version.ToString()
# Attempt to use the GitHub workflow commands to set a variable
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#using-workflow-commands-to-access-toolkit-functions
"MODULE_VERSION=$ModuleVersion" >> $env:GITHUB_OUTPUT
# Return the AWS Tools version from the script as stdout
return $ModuleVersion