diff --git a/examples/demo-asciiart/function/Makefile b/examples/demo-asciiart/function/Makefile
new file mode 100644
index 0000000..7a4eb65
--- /dev/null
+++ b/examples/demo-asciiart/function/Makefile
@@ -0,0 +1,3 @@
+build-DemoAsciiArtFunction:
+ cp -R . $(ARTIFACTS_DIR)
+ rm $(ARTIFACTS_DIR)/Makefile
\ No newline at end of file
diff --git a/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/PSGetModuleInfo.xml b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/PSGetModuleInfo.xml
new file mode 100644
index 0000000..a53c382
--- /dev/null
+++ b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/PSGetModuleInfo.xml
@@ -0,0 +1,137 @@
+
+
+
+ Microsoft.PowerShell.Commands.PSRepositoryItemInfo
+ System.Management.Automation.PSCustomObject
+ System.Object
+
+
+ WriteAscii
+ 1.2.2
+ Module
+ Use Svendsen Tech's Write-Ascii function to produce (optionally colored) ASCII art text letters from strings, in PowerShell. See Get-Help Write-Ascii for more information. GitHub link here: https://github.com/EliteLoser/WriteAscii - online blog documentation here: https://www.powershelladmin.com/wiki/Ascii_art_characters_powershell_script
+ Joakim Borger Svendsen
+ joakimbs
+ Copyright (c) 2012-present, Joakim Borger Svendsen. Svendsen Tech. All rights reserved.
+ 2018-12-08T22:48:45-05:00
+
+ 2022-11-28T12:59:12.419239-05:00
+
+
+
+ Microsoft.PowerShell.Commands.DisplayHintType
+ System.Enum
+ System.ValueType
+ System.Object
+
+ DateTime
+ 2
+
+
+
+
+ https://github.com/EliteLoser/WriteAscii/blob/master/LICENSE
+ https://github.com/EliteLoser/WriteAscii
+
+
+
+ System.Object[]
+ System.Array
+ System.Object
+
+
+ ASCII
+ Write-Ascii
+ Art
+ PSModule
+
+
+
+
+ System.Collections.Hashtable
+ System.Object
+
+
+
+ Function
+
+
+
+ Write-Ascii
+
+
+
+
+ RoleCapability
+
+
+
+
+
+
+ Cmdlet
+
+
+
+ Command
+
+
+
+ Write-Ascii
+
+
+
+
+ Workflow
+
+
+
+ DscResource
+
+
+
+
+
+ * Module manifest updates with links and GitHub links._x000D__x000A_ * Putting this in the PSGallery after a little makeover._x000D__x000A_ * The XML file could do with a larger character set.
+
+
+
+
+ https://www.powershellgallery.com/api/v2
+ PSGallery
+ NuGet
+
+
+ System.Management.Automation.PSCustomObject
+ System.Object
+
+
+ Copyright (c) 2012-present, Joakim Borger Svendsen. Svendsen Tech. All rights reserved.
+ Use Svendsen Tech's Write-Ascii function to produce (optionally colored) ASCII art text letters from strings, in PowerShell. See Get-Help Write-Ascii for more information. GitHub link here: https://github.com/EliteLoser/WriteAscii - online blog documentation here: https://www.powershelladmin.com/wiki/Ascii_art_characters_powershell_script
+ False
+ * Module manifest updates with links and GitHub links._x000D__x000A_ * Putting this in the PSGallery after a little makeover._x000D__x000A_ * The XML file could do with a larger character set.
+ False
+ False
+ 1468
+ 11945
+ 9748
+ 12/8/2018 10:48:45 PM -05:00
+ 12/8/2018 10:48:45 PM -05:00
+ 11/28/2022 5:56:06 PM -05:00
+ ASCII Write-Ascii Art PSModule PSFunction_Write-Ascii PSCommand_Write-Ascii PSIncludes_Function
+ False
+ 2022-11-28T17:56:06Z
+ 1.2.2
+ Joakim Borger Svendsen
+ false
+ Module
+ WriteAscii.nuspec|letters.xml|WriteAscii.psd1|WriteAscii.psm1
+ bf3e3bb5-97de-416a-97d7-edf403fa7976
+ 2.0
+ Svendsen Tech
+
+
+ /Users/andyhopp/.local/share/powershell/Modules/WriteAscii/1.2.2
+
+
+
diff --git a/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/WriteAscii.psd1 b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/WriteAscii.psd1
new file mode 100644
index 0000000..1073100
--- /dev/null
+++ b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/WriteAscii.psd1
@@ -0,0 +1,132 @@
+#
+# Module manifest for module 'PSGet_Write-Ascii'
+#
+# Generated by: Joakim Svendsen
+#
+# Generated on: 7/26/2018
+#
+
+@{
+
+# Script module or binary module file associated with this manifest.
+# RootModule = ''
+# for PSv2-compatibility at no other cost.. (gallery requires PSv3+, but this lets
+# me use the same version of the manifest also for v2)
+ModuleToProcess = 'WriteAscii.psm1'
+
+# Version number of this module.
+ModuleVersion = '1.2.2'
+
+# Supported PSEditions
+# CompatiblePSEditions = @()
+
+# ID used to uniquely identify this module
+GUID = 'bf3e3bb5-97de-416a-97d7-edf403fa7976'
+
+# Author of this module
+Author = 'Joakim Borger Svendsen'
+
+# Company or vendor of this module
+CompanyName = 'Svendsen Tech'
+
+# Copyright statement for this module
+Copyright = 'Copyright (c) 2012-present, Joakim Borger Svendsen. Svendsen Tech. All rights reserved.'
+
+# Description of the functionality provided by this module
+Description = 'Use Svendsen Tech''s Write-Ascii function to produce (optionally colored) ASCII art text letters from strings, in PowerShell. See Get-Help Write-Ascii for more information. GitHub link here: https://github.com/EliteLoser/WriteAscii - online blog documentation here: https://www.powershelladmin.com/wiki/Ascii_art_characters_powershell_script'
+
+# Minimum version of the Windows PowerShell engine required by this module
+PowerShellVersion = '2.0'
+
+# Name of the Windows PowerShell host required by this module
+# PowerShellHostName = ''
+
+# Minimum version of the Windows PowerShell host required by this module
+# PowerShellHostVersion = ''
+
+# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+# DotNetFrameworkVersion = ''
+
+# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+# CLRVersion = ''
+
+# Processor architecture (None, X86, Amd64) required by this module
+# ProcessorArchitecture = ''
+
+# Modules that must be imported into the global environment prior to importing this module
+# RequiredModules = @()
+
+# Assemblies that must be loaded prior to importing this module
+# RequiredAssemblies = @()
+
+# Script files (.ps1) that are run in the caller's environment prior to importing this module.
+# ScriptsToProcess = @()
+
+# Type files (.ps1xml) to be loaded when importing this module
+# TypesToProcess = @()
+
+# Format files (.ps1xml) to be loaded when importing this module
+# FormatsToProcess = @()
+
+# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
+# NestedModules = @()
+
+# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
+FunctionsToExport = 'Write-Ascii'
+
+# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
+CmdletsToExport = @()
+
+# Variables to export from this module
+# VariablesToExport = @()
+
+# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
+AliasesToExport = @()
+
+# DSC resources to export from this module
+# DscResourcesToExport = @()
+
+# List of all modules packaged with this module
+# ModuleList = @()
+
+# List of all files packaged with this module
+FileList = 'WriteAscii.psm1', 'WriteAscii.psd1', 'letters.xml'
+
+# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
+PrivateData = @{
+
+ PSData = @{
+
+ # Tags applied to this module. These help with module discovery in online galleries.
+ Tags = @('ASCII', 'Write-Ascii', 'Art')
+
+ # A URL to the license for this module.
+ LicenseUri = 'https://github.com/EliteLoser/WriteAscii/blob/master/LICENSE'
+
+ # A URL to the main website for this project.
+ ProjectUri = 'https://github.com/EliteLoser/WriteAscii'
+
+ # A URL to an icon representing this module.
+ # IconUri = ''
+
+ # ReleaseNotes of this module
+ ReleaseNotes = '
+ * Module manifest updates with links and GitHub links.
+ * Putting this in the PSGallery after a little makeover.
+ * The XML file could do with a larger character set.'
+
+ # External dependent modules of this module
+ # ExternalModuleDependencies = ''
+
+ } # End of PSData hashtable
+
+} # End of PrivateData hashtable
+
+# HelpInfo URI of this module
+HelpInfoURI = 'https://www.powershelladmin.com/wiki/Ascii_art_characters_powershell_script'
+
+# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
+# DefaultCommandPrefix = ''
+
+}
+
diff --git a/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/WriteAscii.psm1 b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/WriteAscii.psm1
new file mode 100644
index 0000000..c49b46d
--- /dev/null
+++ b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/WriteAscii.psm1
@@ -0,0 +1,406 @@
+<#
+.SYNOPSIS
+Svendsen Tech's PowerShell ASCII art module creates ASCII art characters
+from a subset of common letters, numbers and punctuation characters.
+You can add new characters by editing the XML (for developers).
+
+MIT license.
+
+Copyright (c) 2012-present, Joakim Borger Svendsen, Svendsen Tech.
+All rights reserved.
+
+.DESCRIPTION
+This script reads characters from an XML file that's expected to have the name
+"letters.xml", be encoded in UTF-8 and to be in the module's working directory.
+
+It was written to be used in conjunction with a modified version of
+PowerBot (http://poshcode.org/2510), a simple IRC bot framework written
+using SmartIrc4Net; that's why it can prepend an apostrophe - because somewhere
+along the way the leading spaces get lost before it hits the IRC channel.
+
+Currently the XML only contains lowercase letters, mostly because PowerShell/
+Windows is case-insensitive by default, which isn't an advantage here.
+
+Example:
+PS C:\> Import-Module WriteAscii
+PS C:\> Write-Ascii "ASCII!"
+ _ _ _
+ __ _ ___ ___ (_)(_)| |
+ / _` |/ __| / __|| || || |
+| (_| |\__ \| (__ | || ||_|
+ \__,_||___/ \___||_||_|(_)
+PS C:\>
+
+.PARAMETER InputText
+String(s) to convert to ASCII.
+.PARAMETER PrependChar
+Optional. Makes the script prepend an apostrophe.
+.PARAMETER Compression
+Optional. Compress to five lines when possible, even when it causes incorrect
+alignment of the letters g, y, p and q (and "¤").
+.PARAMETER ForegroundColor
+Optional. Console only. Changes text foreground color.
+.PARAMETER BackgroundColor
+Optional. Console only. Changes text background color.
+#>
+
+function Write-Ascii {
+# Wrapping the script in a function to make it a module
+
+[CmdletBinding()]
+param(
+ [Parameter(
+ ValueFromPipeline = $True,
+ Mandatory = $True)]
+ [Alias('InputText')]
+ [String[]] $InputObject,
+ [Switch] $PrependChar,
+ [Switch] $Compression,
+ [String] $ForegroundColor = 'Default',
+ [String] $BackgroundColor = 'Default'
+ #[int] $MaxChars = '25'
+ )
+
+begin {
+
+ Set-StrictMode -Version Latest
+ $ErrorActionPreference = 'Stop'
+
+ # Algorithm from hell... This was painful. I hope there's a better way.
+ function Get-Ascii {
+
+ param([String] $Text)
+
+ $LetterArray = [Char[]] $Text.ToLower()
+
+ #Write-Host -fore green $LetterArray
+
+ # Find the letter with the most lines.
+ $MaxLines = 0
+ $LetterArray | ForEach-Object {
+ if ($Letters.([String] $_).Lines -gt $MaxLines ) {
+ $MaxLines = $Letters.([String] $_).Lines
+ }
+ }
+
+ # Now this sure was a simple way of making sure all letter align tidily without changing a lot of code!
+ if (-not $Compression) { $MaxLines = 6 }
+
+ $LetterWidthArray = $LetterArray | ForEach-Object {
+ $Letter = [String] $_
+ $Letters.$Letter.Width
+ }
+ $LetterLinesArray = $LetterArray | ForEach-Object {
+ $Letter = [String] $_
+ $Letters.$Letter.Lines
+ }
+
+ #$LetterLinesArray
+
+ $Lines = @{
+ '1' = ''
+ '2' = ''
+ '3' = ''
+ '4' = ''
+ '5' = ''
+ '6' = ''
+ }
+
+ #$LineLengths = @(0, 0, 0, 0, 0, 0)
+
+ # Debug
+ #Write-Host "MaxLines: $Maxlines"
+
+ $LetterPos = 0
+ foreach ($Letter in $LetterArray) {
+
+ # We need to work with strings for indexing the hash by letter
+ $Letter = [String] $Letter
+
+ # Each ASCII letter can be from 4 to 6 lines.
+
+ # If the letter has the maximum of 6 lines, populate hash with all lines.
+ if ($LetterLinesArray[$LetterPos] -eq 6) {
+
+ #Write-Host "Six letter letter"
+
+ foreach ($Num in 1..6) {
+
+ $LineFragment = [String](($Letters.$Letter.ASCII).Split("`n"))[$Num-1]
+
+ if ($LineFragment.Length -lt $Letters.$Letter.Width) {
+ $LineFragment += ' ' * ($Letters.$Letter.Width - $LineFragment.Length)
+ }
+
+ $StringNum = [String] $Num
+ $Lines.$StringNum += $LineFragment
+
+ }
+
+ }
+
+ # Add padding for line 1 for letters with 5 lines and populate lines 2-6.
+ ## Changed to top-adjust 5-line letters if there are 6 total.
+ ## Added XML properties for letter alignment. Most are "default", which is top-aligned.
+ ## Also added script logic to handle it (2012-12-29): bottom
+ elseif ($LetterLinesArray[$LetterPos] -eq 5) {
+
+ if ($MaxLines -lt 6 -or $Letters.$Letter.fixation -eq 'bottom') {
+
+ $Padding = ' ' * $LetterWidthArray[$LetterPos]
+ $Lines.'1' += $Padding
+
+ foreach ($Num in 2..6) {
+
+ $LineFragment = [String](($Letters.$Letter.ASCII).Split("`n"))[$Num-2]
+
+ if ($LineFragment.Length -lt $Letters.$Letter.Width) {
+ $LineFragment += ' ' * ($Letters.$Letter.Width - $LineFragment.Length)
+ }
+
+ $StringNum = [String] $Num
+ $Lines.$StringNum += $LineFragment
+
+ }
+
+ }
+
+ else {
+
+ $Padding = ' ' * $LetterWidthArray[$LetterPos]
+ $Lines.'6' += $Padding
+
+ foreach ($Num in 1..5) {
+
+ $StringNum = [String] $Num
+
+ $LineFragment = [String](($Letters.$Letter.ASCII).Split("`n"))[$Num-1]
+
+ if ($LineFragment.Length -lt $Letters.$Letter.Width) {
+ $LineFragment += ' ' * ($Letters.$Letter.Width - $LineFragment.Length)
+ }
+
+ $Lines.$StringNum += $LineFragment
+
+ }
+
+ }
+
+ }
+
+ # Here we deal with letters with four lines.
+ # Dynamic algorithm that places four-line letters on the bottom line if there are
+ # 4 or 5 lines only in the letter with the most lines.
+ else {
+
+ # Default to putting the 4-liners at line 3-6
+ $StartRange, $EndRange, $IndexSubtract = 3, 6, 3
+ $Padding = ' ' * $LetterWidthArray[$LetterPos]
+
+ # If there are 4 or 5 lines...
+ if ($MaxLines -lt 6) {
+
+ $Lines.'2' += $Padding
+
+ }
+
+ # There are 6 lines maximum, put 4-line letters in the middle.
+ else {
+
+ $Lines.'1' += $Padding
+ $Lines.'6' += $Padding
+ $StartRange, $EndRange, $IndexSubtract = 2, 5, 2
+
+ }
+
+ # There will always be at least four lines. Populate lines 2-5 or 3-6 in the hash.
+ foreach ($Num in $StartRange..$EndRange) {
+
+ $StringNum = [String] $Num
+
+ $LineFragment = [String](($Letters.$Letter.ASCII).Split("`n"))[$Num-$IndexSubtract]
+
+ if ($LineFragment.Length -lt $Letters.$Letter.Width) {
+ $LineFragment += ' ' * ($Letters.$Letter.Width - $LineFragment.Length)
+ }
+
+ $Lines.$StringNum += $LineFragment
+
+ }
+
+ }
+
+ $LetterPos++
+
+ } # end of LetterArray foreach
+
+ # Return stuff
+ $Lines.GetEnumerator() |
+ Sort-Object -Property Name |
+ Select -ExpandProperty Value |
+ Where-Object {
+ $_ -match '\S'
+ } | ForEach-Object {
+ if ($PrependChar) {
+ "'" + $_
+ }
+ else {
+ $_
+ }
+ }
+
+ }
+
+ # Populate the $Letters hashtable with character data from the XML.
+ Function Get-LetterXML {
+
+ $LetterFile = Join-Path $PSScriptRoot 'letters.xml'
+ $Xml = [xml] (Get-Content $LetterFile)
+
+ $Xml.Chars.Char | ForEach-Object {
+
+ $Letters.($_.Name) = New-Object PSObject -Property @{
+
+ 'Fixation' = $_.fixation
+ 'Lines' = $_.lines
+ 'ASCII' = $_.data
+ 'Width' = $_.width
+
+ }
+
+ }
+
+ }
+
+ function Write-RainbowString {
+
+ param([String] $Line,
+ [String] $ForegroundColor = '',
+ [String] $BackgroundColor = '')
+
+ $Colors = @('Black', 'DarkBlue', 'DarkGreen', 'DarkCyan', 'DarkRed', 'DarkMagenta', 'DarkYellow',
+ 'Gray', 'DarkGray', 'Blue', 'Green', 'Cyan', 'Red', 'Magenta', 'Yellow', 'White')
+
+
+ # $Colors[(Get-Random -Min 0 -Max 16)]
+
+ [Char[]] $Line | %{
+
+ if ($ForegroundColor -and $ForegroundColor -ieq 'rainbow') {
+
+ if ($BackgroundColor -and $BackgroundColor -ieq 'rainbow') {
+ Write-Host -ForegroundColor $Colors[(
+ Get-Random -Min 0 -Max 16
+ )] -BackgroundColor $Colors[(
+ Get-Random -Min 0 -Max 16
+ )] -NoNewline $_
+ }
+ elseif ($BackgroundColor) {
+ Write-Host -ForegroundColor $Colors[(
+ Get-Random -Min 0 -Max 16
+ )] -BackgroundColor $BackgroundColor `
+ -NoNewline $_
+ }
+ else {
+ Write-Host -ForegroundColor $Colors[(
+ Get-Random -Min 0 -Max 16
+ )] -NoNewline $_
+ }
+
+ }
+ # One of them has to be a rainbow, so we know the background is a rainbow here...
+ else {
+
+ if ($ForegroundColor) {
+ Write-Host -ForegroundColor $ForegroundColor -BackgroundColor $Colors[(
+ Get-Random -Min 0 -Max 16
+ )] -NoNewline $_
+ }
+ else {
+ Write-Host -BackgroundColor $Colors[(Get-Random -Min 0 -Max 16)] -NoNewline $_
+ }
+ }
+
+ }
+
+ Write-Host ''
+
+ }
+
+ # Get ASCII art letters/characters and data from XML. Make it persistent for the module.
+ if (-not (Get-Variable -EA SilentlyContinue -Scope Script -Name Letters)) {
+ $script:Letters = @{}
+ Get-LetterXML
+ }
+
+ # Turn the [string[]] into a [String] the only way I could figure out how... wtf
+ #$Text = ''
+ #$InputObject | ForEach-Object { $Text += "$_ " }
+
+ # Limit to 30 characters
+ #$MaxChars = 30
+ #if ($Text.Length -gt $MaxChars) { "Too long text. There's a maximum of $MaxChars characters."; return }
+
+ # Replace spaces with underscores (that's what's used for spaces in the XML).
+ #$Text = $Text -replace ' ', '_'
+
+ # Define accepted characters (which are found in XML).
+ #$AcceptedChars = '[^a-z0-9 _,!?./;:<>()¤{}\[\]\|\^=\$\-''+`\\"æøåâàáéèêóòôü]' # Some chars only works when sent as UTF-8 on IRC
+ $LetterArray = [string[]]($Letters.GetEnumerator() | Sort-Object -Property Name | Select-Object -ExpandProperty Name)
+ $AcceptedChars = [regex] ( '(?i)[^' + ([regex]::Escape(($LetterArray -join '')) -replace '-', '\-' -replace '\]', '\]') + ' ]' )
+ # Debug
+ #Write-Host -fore cyan $AcceptedChars.ToString()
+ }
+
+ process {
+ if ($InputObject -match $AcceptedChars) {
+ "Unsupported character, using these accepted characters: " + ($LetterArray -replace '^template$' -join ', ') + "."
+ return
+ }
+
+ # Filthy workaround (now worked around in the foreach creating the string).
+ #if ($Text.Length -eq 1) { $Text += '_' }
+
+ $Lines = @()
+
+ foreach ($Text in $InputObject) {
+
+ $ASCII = Get-Ascii ($Text -replace ' ', '_')
+
+ if ($ForegroundColor -ne 'Default' -and $BackgroundColor -ne 'Default') {
+ if ($ForegroundColor -ieq 'rainbow' -or $BackGroundColor -ieq 'rainbow') {
+ $ASCII | ForEach-Object {
+ Write-RainbowString -ForegroundColor $ForegroundColor -BackgroundColor $BackgroundColor -Line $_
+ }
+ }
+ else {
+ Write-Host -ForegroundColor $ForegroundColor -BackgroundColor $BackgroundColor ($ASCII -join "`n")
+ }
+ }
+ elseif ($ForegroundColor -ne 'Default') {
+ if ($ForegroundColor -ieq 'rainbow') {
+ $ASCII | ForEach-Object {
+ Write-RainbowString -ForegroundColor $ForegroundColor -Line $_
+ }
+ }
+ else {
+ Write-Host -ForegroundColor $ForegroundColor ($ASCII -join "`n")
+ }
+ }
+ elseif ($BackgroundColor -ne 'Default') {
+ if ($BackgroundColor -ieq 'rainbow') {
+ $ASCII | ForEach-Object {
+ Write-RainbowString -BackgroundColor $BackgroundColor -Line $_
+ }
+ }
+ else {
+ Write-Host -BackgroundColor $BackgroundColor ($ASCII -join "`n")
+ }
+ }
+ else { $ASCII -replace '\s+$' }
+
+ } # end of foreach
+
+ } # end of process block
+
+} # end of function
diff --git a/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/letters.xml b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/letters.xml
new file mode 100644
index 0000000..610d35b
--- /dev/null
+++ b/examples/demo-asciiart/function/modules/WriteAscii/1.2.2/letters.xml
@@ -0,0 +1,994 @@
+
+
+ a
+ default
+ 4
+ 7
+ __ _
+ / _` |
+| (_| |
+ \__,_|
+
+
+
+ ä
+ default
+ 5
+ 7
+ _ _
+(_)_(_)
+ / _` |
+| (_| |
+ \__,_|
+
+
+
+ à
+ default
+ 5
+ 7
+ __
+ \_\_
+ / _` |
+| (_| |
+ \__,_|
+
+
+
+ á
+ default
+ 5
+ 7
+ __
+ /_/_
+ / _` |
+| (_| |
+ \__,_|
+
+
+
+ â
+ default
+ 5
+ 7
+ //\
+ |/_\|
+ / _` |
+| (_| |
+ \__,_|
+
+
+
+ b
+ default
+ 5
+ 7
+ _
+| |__
+| '_ \
+| |_) |
+|_.__/
+
+
+
+ c
+ default
+ 4
+ 6
+ ___
+ / __|
+| (__
+ \___|
+
+
+
+ d
+ default
+ 5
+ 7
+ _
+ __| |
+ / _` |
+| (_| |
+ \__,_|
+
+
+
+ e
+ default
+ 4
+ 6
+ ___
+ / _ \
+| __/
+ \___|
+
+
+
+ é
+ default
+ 5
+ 6
+ __
+ /_/
+ / _ \
+| __/
+ \___|
+
+
+
+ è
+ default
+ 5
+ 6
+ __
+ \_\
+ / _ \
+| __/
+ \___|
+
+
+
+ ê
+ default
+ 5
+ 6
+ //\
+ |/_\|
+ / _ \
+| __/
+ \___|
+
+
+
+ f
+ default
+ 5
+ 5
+ __
+ / _|
+| |_
+| _|
+|_|
+
+
+
+ g
+ bottom
+ 5
+ 7
+ __ _
+ / _` |
+| (_| |
+ \__, |
+ |___/
+
+
+ h
+ default
+ 5
+ 7
+ _
+| |__
+| '_ \
+| | | |
+|_| |_|
+
+
+ i
+ default
+ 5
+ 3
+ _
+(_)
+| |
+| |
+|_|
+
+
+ j
+ default
+ 6
+ 5
+ _
+ (_)
+ | |
+ | |
+ _/ |
+|__/
+
+
+ k
+ default
+ 5
+ 6
+ _
+| | __
+| |/ /
+| <
+|_|\_\
+
+
+ l
+ default
+ 5
+ 3
+ _
+| |
+| |
+| |
+|_|
+
+
+ m
+ default
+ 4
+ 11
+ _ __ ___
+| '_ ` _ \
+| | | | | |
+|_| |_| |_|
+
+
+
+ n
+ default
+ 4
+ 7
+ _ __
+| '_ \
+| | | |
+|_| |_|
+
+
+
+ o
+ default
+ 4
+ 7
+ ___
+ / _ \
+| (_) |
+ \___/
+
+
+ ö
+ default
+ 5
+ 7
+ _ _
+(_)_(_)
+ / _ \
+| (_) |
+ \___/
+
+
+
+
+ ò
+ default
+ 5
+ 7
+ __
+ \_\
+ / _ \
+| (_) |
+ \___/
+
+
+
+ ó
+ default
+ 5
+ 7
+ __
+ /_/
+ / _ \
+| (_) |
+ \___/
+
+
+
+ ô
+ default
+ 5
+ 7
+ //\
+ |/_\|
+ / _ \
+| (_) |
+ \___/
+
+
+
+ p
+ bottom
+ 5
+ 7
+ _ __
+| '_ \
+| |_) |
+| .__/
+|_|
+
+
+ q
+ bottom
+ 5
+ 7
+ __ _
+ / _` |
+| (_| |
+ \__, |
+ |_|
+
+
+
+ r
+ default
+ 4
+ 6
+ _ __
+| '__|
+| |
+|_|
+
+
+
+ s
+ default
+ 4
+ 5
+ ___
+/ __|
+\__ \
+|___/
+
+
+ t
+ default
+ 5
+ 5
+ _
+| |_
+| __|
+| |_
+ \__|
+
+
+
+ u
+ default
+ 4
+ 7
+ _ _
+| | | |
+| |_| |
+ \__,_|
+
+
+
+ ü
+ default
+ 5
+ 7
+ _ _
+(_) (_)
+| | | |
+| |_| |
+ \__,_|
+
+
+
+
+ v
+ default
+ 4
+ 7
+__ __
+\ \ / /
+ \ V /
+ \_/
+
+
+
+
+ w
+ default
+ 4
+ 10
+__ __
+\ \ /\ / /
+ \ V V /
+ \_/\_/
+
+
+
+
+ x
+ default
+ 4
+ 6
+__ __
+\ \/ /
+ > <
+/_/\_\
+
+
+
+
+ y
+ 5
+ bottom
+ 7
+ _ _
+| | | |
+| |_| |
+ \__, |
+ |___/
+
+
+
+ z
+ default
+ 4
+ 5
+ ____
+|_ /
+ / /
+/___|
+
+
+
+ æ
+ default
+ 4
+ 10
+ __ ____
+ / _` _ \
+| (_| __/
+ \__,____|
+
+
+
+
+ ø
+ default
+ 4
+ 8
+ ____
+ / _//\
+| (//) |
+ \//__/
+
+
+
+ å
+ default
+ 5
+ 7
+ __
+ (())
+ / _ '|
+| (_| |
+ \__,_|
+
+
+
+ _
+ default
+ 4
+ 3
+
+
+
+
+
+
+
+ !
+ default
+ 5
+ 3
+ _
+| |
+| |
+|_|
+(_)
+
+
+
+ ?
+ default
+ 5
+ 5
+ ___
+|__ \
+ / /
+ |_|
+ (_)
+
+
+
+ ,
+ default
+ 4
+ 3
+
+ _
+( )
+|/
+
+
+
+ .
+ default
+ 4
+ 3
+
+
+ _
+(_)
+
+
+
+ -
+ default
+ 4
+ 7
+
+ _____
+|_____|
+
+
+
+
+ 1
+ default
+ 5
+ 3
+ _
+/ |
+| |
+| |
+|_|
+
+
+
+ 2
+ default
+ 5
+ 7
+ ____
+|___ \
+ __) |
+ / __/
+|_____|
+
+
+
+ 3
+ default
+ 5
+ 7
+ _____
+|___ /
+ |_ \
+ ___) |
+|____/
+
+
+
+ 4
+ default
+ 5
+ 8
+ _ _
+| || |
+| || |_
+|__ _|
+ |_|
+
+
+
+ 5
+ default
+ 5
+ 7
+ ____
+| ___|
+|___ \
+ ___) |
+|____/
+
+
+
+ 6
+ default
+ 5
+ 7
+ __
+ / /_
+| '_ \
+| (_) |
+ \___/
+
+
+
+ 7
+ default
+ 5
+ 7
+ _____
+|___ |
+ / /
+ / /
+ /_/
+
+
+
+ 8
+ default
+ 5
+ 7
+ ___
+ ( _ )
+ / _ \
+| (_) |
+ \___/
+
+
+
+ 9
+ default
+ 5
+ 7
+ ___
+ / _ \
+| (_) |
+ \__, |
+ /_/
+
+
+
+ 0
+ default
+ 5
+ 7
+ ___
+ / _ \
+| | | |
+| |_| |
+ \___/
+
+
+
+ :
+ default
+ 4
+ 3
+ _
+(_)
+ _
+(_)
+
+
+
+ ;
+ default
+ 5
+ 3
+ _
+(_)
+ _
+( )
+|/
+
+
+
+ (
+ default
+ 6
+ 5
+ __
+ / /
+ | |
+ | |
+ | |
+ \_\
+
+
+
+ )
+ default
+ 6
+ 5
+ __
+ \ \
+ | |
+ | |
+ | |
+ /_/
+
+
+
+ <
+ default
+ 5
+ 5
+ __
+ / /
+ / /
+ \ \
+ \_\
+
+
+
+ >
+ default
+ 5
+ 5
+ __
+ \ \
+ \ \
+ / /
+ /_/
+
+
+
+ [
+ default
+ 6
+ 5
+ __
+ | _|
+ | |
+ | |
+ | |
+ |__|
+
+
+
+ ]
+ default
+ 6
+ 5
+ __
+ |_ |
+ | |
+ | |
+ | |
+ |__|
+
+
+
+ {
+ default
+ 6
+ 6
+ __
+ / /
+ | |
+ < <
+ | |
+ \_\
+
+
+
+ }
+ default
+ 6
+ 6
+ __
+ \ \
+ | |
+ > >
+ | |
+ /_/
+
+
+
+ /
+ default
+ 5
+ 7
+ __
+ / /
+ / /
+ / /
+ /_/
+
+
+
+ \
+ default
+ 5
+ 7
+ __
+ \ \
+ \ \
+ \ \
+ \_\
+
+
+
+ +
+ default
+ 4
+ 7
+ _
+ _| |_
+|_ _|
+ |_|
+
+
+
+ |
+ default
+ 6
+ 3
+ _
+| |
+| |
+| |
+| |
+|_|
+
+
+
+ `
+ default
+ 5
+ 3
+ _
+( )
+ \|
+
+
+
+
+
+ '
+ default
+ 5
+ 3
+ _
+( )
+|/
+
+
+
+
+
+
+
+ "
+ default
+ 5
+ 5
+ _ _
+( | )
+ V V
+
+
+
+
+
+ ¤
+ 5
+ bottom
+ 7
+ /\___/\
+\ _ /
+| (_) |
+/ ___ \
+\/ \/
+
+
+
+ '
+ default
+ 5
+ 3
+ _
+( )
+|/
+
+
+
+
+
+ *
+ default
+ 4
+ 6
+__/\__
+\ /
+/_ _\
+ \/
+
+
+
+
+ ^
+ default
+ 4
+ 4
+ /\
+|/\|
+
+
+
+
+
+
+ $
+ default
+ 6
+ 5
+ _
+ | |
+/ __)
+\__ \
+( /
+ |_|
+
+
+
+ =
+ default
+ 4
+ 7
+ _____
+|_____|
+|_____|
+
+
+
+
+ £
+ default
+ 5
+ 8
+ ___
+ / ,_\
+_| |_
+ | |___
+(_,____|
+
+
+
+ @
+ default
+ 6
+ 9
+ ____
+ / __ \
+ / / _` |
+| | (_| |
+ \ \__,_|
+ \____/
+
+
+
+ #
+ default
+ 5
+ 10
+ _ _
+ _| || |_
+|_ .. _|
+|_ _|
+ |_||_|
+
+
+
+ template
+ default
+ 5
+ 6
+
+
+
+
+
diff --git a/examples/demo-asciiart/function/script.ps1 b/examples/demo-asciiart/function/script.ps1
new file mode 100644
index 0000000..8b0f908
--- /dev/null
+++ b/examples/demo-asciiart/function/script.ps1
@@ -0,0 +1,2 @@
+Import-Module WriteAscii
+Write-Ascii 'Hello, Powershell!'
\ No newline at end of file
diff --git a/examples/demo-asciiart/readme.md b/examples/demo-asciiart/readme.md
new file mode 100644
index 0000000..28ec55f
--- /dev/null
+++ b/examples/demo-asciiart/readme.md
@@ -0,0 +1,106 @@
+# Demo-ASCIIArt
+
+This is a demo SAM application [demo-asciiart](examples/demo-asciiart/) uses AWS SAM to deploy a Lambda function that uses a Powershell script to render ASCII art using the WriteAscii Powershell module.
+
+### Pre-requisites:
+* Deploy the [reusable-runtime](examples/reusable-runtime/) example.
+* [AWS Serverless Application Model (AWS SAM)](https://aws.amazon.com/serverless/sam/)
+
+Clone the repository and change into the example directory
+```
+git clone https://github.com/awslabs/aws-lambda-powershell-runtime
+cd aws-lambda-powershell-runtime/examples/demo-asciiart
+```
+Use one of the *"Build"* options, A,B,C, depending on your operating system and tools.
+
+### A) Build using Linux or WSL
+Build the custom runtime, Lambda layer, and function packages using native Linux or WSL.
+```
+sam build --parallel
+```
+
+
+### B) Build using Docker
+You can build the custom runtime, Lambda layer, and function packages using Docker. This uses a Linux-based Lambda-like Docker container to build the packages. Use this option for Windows without WSL or as an isolated Mac/Linux build environment.
+
+```
+sam build --parallel --use-container
+```
+
+
+### Test the function locally
+
+Once the build process is complete, you can use AWS SAM to test the function locally.
+
+```
+sam local invoke
+```
+This uses a Lambda-like environment to run the function locally and returns the function response, which is an ASCII art rendering of "Hello, World!".
+
+
+
+### Deploying to the AWS Cloud
+Use AWS SAM to deploy the resources to your AWS account. Run a guided deployment to set the default parameters for the first deploy.
+```
+sam deploy -g
+```
+For subsequent deployments you can use `sam deploy`.
+
+Enter a **Stack Name** and accept the remaining initial defaults.
+
+
+
+AWS SAM deploys the infrastructure and outputs the details of the resources.
+
+
+
+### View, edit, and invoke the function in the AWS Management Console
+
+You can view, edit code, and invoke the Lambda function in the Lambda Console.
+
+Navigate to the *Functions* page and choose the function specified in the `sam deploy` *Outputs*.
+
+Using the built-in [code editor](https://docs.aws.amazon.com/lambda/latest/dg/foundation-console.html#code-editor), you can view the function code.
+
+
+
+To invoke the function, select the **Test** button and create a test event. For more information on invoking a function with a test event, see the [documentation](https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html#get-started-invoke-manually).
+
+You can see the results in the *Execution result* pane.
+
+You can also view a snippet of the generated *Function Logs* below the *Response*. View the full logs in [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs). You can navigate directly via the *Monitor* tab.
+
+
+
+### Invoke the function using the AWS CLI
+
+From a command prompt, invoke the function. Amend the `--function-name` and `--region` values for your function. This should return `"StatusCode": 200` for a successful invoke.
+
+````
+aws lambda invoke --function-name "DemoAsciiArtFunction-6W3bn1znmW8G" --region us-east-1 invoke-result
+````
+
+View the function results which are outputted to `invoke-result`.
+
+````
+cat invoke-result
+````
+
+
+
+### Invoke the function using the AWS Tools for PowerShell
+
+You can invoke the Lambda function using the AWS Tools for PowerShell and capture the response in a variable. The response is available in the `Payload` property of the `$result` object which can be read using the .NET `StreamReader` class.
+````
+$Response = Invoke-LMFunction -FunctionName DemoAsciiArtFunction-HHdKLkXxnkUn -LogType Tail
+[System.IO.StreamReader]::new($Response.Payload).ReadToEnd()
+
+````
+This outputs the ASCII art response.
+
+## Cleanup
+
+To delete the AWS resources created, run the following and confirm that you want to delete the resources that were created by this template.
+````
+sam delete
+````
diff --git a/examples/demo-asciiart/template.yml b/examples/demo-asciiart/template.yml
new file mode 100644
index 0000000..8f030c9
--- /dev/null
+++ b/examples/demo-asciiart/template.yml
@@ -0,0 +1,22 @@
+AWSTemplateFormatVersion: '2010-09-09'
+Transform: AWS::Serverless-2016-10-31
+Description: A demo using the reusable runtime (must be deployed first)
+##########################################################################
+# Parameters & Globals #
+##########################################################################
+Resources:
+##########################################################################
+# Lambda functions #
+##########################################################################
+ DemoAsciiArtFunction:
+ Type: AWS::Serverless::Function
+ Properties:
+ Description: PowerShell-Lambda-Runtime Demo Function
+ CodeUri: function/
+ Runtime: provided.al2
+ Architectures: [ arm64 ]
+ Handler: script.ps1
+ MemorySize: 1024
+ Timeout: 100
+ Layers: [ '{{resolve:ssm:lambda-powershell-runtime-arm64-latest-version-arn}}' ]
+
diff --git a/examples/reusable-pwsh-runtime/readme.md b/examples/reusable-pwsh-runtime/readme.md
new file mode 100644
index 0000000..49a9353
--- /dev/null
+++ b/examples/reusable-pwsh-runtime/readme.md
@@ -0,0 +1,109 @@
+# Demo-reusable-pwsh-runtime
+
+A set of reusable Lambda layers [reusable-pwsh-runtime](examples/reusable-pwsh-runtime/) uses AWS SAM to deploy the following:
+1. PowerShell custom runtimes for arm64 and x64 processor architectures based on ````provided.al2```` as a Lambda layer.
+2. Additional Lambda layer including the [AWSTools for PowerShell](https://aws.amazon.com/powershell/) with the following module.
+ * ````AWS.Tools.Common````
+3. Both layers store their Amazon Resource Names (ARNs) as parameters in [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html) which can be referenced in other templates
+
+To build the custom runtime and the AWS Tools for PowerShell layer for this example, AWS SAM uses a Makefile. This downloads the specified version of [PowerShell](https://github.com/PowerShell/PowerShell/releases/) and select modules from the [AWSTools](https://sdk-for-net.amazonwebservices.com/ps/v4/latest/AWS.Tools.zip)
+
+Windows does not natively support Makefiles. When using Windows, you can use either [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about), [Docker Desktop](https://docs.docker.com/get-docker/) or native PowerShell.
+
+### Pre-requisites:
+* [AWS Serverless Application Model (AWS SAM)](https://aws.amazon.com/serverless/sam/)
+* If building on Windows:
+ * [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) *or*
+ * [Docker Desktop](https://docs.docker.com/get-docker/) *or*
+ * [PowerShell for Windows](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows)
+
+Clone the repository and change into the example directory
+```
+git clone https://github.com/awslabs/aws-lambda-powershell-runtime
+cd aws-lambda-powershell-runtime/examples/reusable-pwsh-runtime
+```
+Use one of the *"Build"* options, A,B,C, depending on your operating system and tools.
+
+### A) Build using Linux or WSL
+Build the custom runtime, Lambda layer, and function packages using native Linux or WSL.
+```
+sam build --parallel
+```
+
+
+### B) Build using Docker
+You can build the custom runtime, Lambda layer, and function packages using Docker. This uses a Linux-based Lambda-like Docker container to build the packages. Use this option for Windows without WSL or as an isolated Mac/Linux build environment.
+
+```
+sam build --parallel --use-container
+```
+
+
+### C) Build using PowerShell for Windows
+You can use native PowerShell for Windows to download and extract the custom runtime and Lambda layer files. This performs the same file copy functionality as the Makefile. It adds the files to the source folders rather than a build location for subsequent deployment with AWS SAM. Use this option for Windows without WSL or Docker.
+
+```
+.\build-layers.ps1
+```
+
+
+### Test the function locally
+
+Once the build process is complete, you can use AWS SAM to test the function locally.
+
+```
+sam local invoke
+```
+This uses a Lambda-like environment to run the function locally and returns the function response, which is the result of `Get-AWSRegion`.
+
+
+
+### Deploying to the AWS Cloud
+Use AWS SAM to deploy the resources to your AWS account. Run a guided deployment to set the default parameters for the first deploy.
+```
+sam deploy -g
+```
+For subsequent deployments you can use `sam deploy`.
+
+Enter a **Stack Name** and accept the remaining initial defaults.
+
+
+
+AWS SAM deploys the infrastructure and outputs the details of the resources.
+
+
+
+### Using the reusable runtimes and AWS.Tools.Common layer in a SAM template
+
+This example deploys layers that can be used to build a Lambda function written in Powershell. Each runtime registers a Systems Manager Parameter Store parameter with the value being the Amazon Resource Name (ARN) of the latest version of that layer:
+* Arm64: lambda-powershell-runtime-arm64-latest-version-arn
+* x86_64: lambda-powershell-runtime-x64-latest-version-arn
+* AWS.Tools.Common: lambda-powershell-PSAWSTools-latest-version-arn
+
+An example of usage:
+```
+AWSTemplateFormatVersion: '2010-09-09'
+Transform: AWS::Serverless-2016-10-31
+
+Resources:
+ MyPowershellFunction:
+ Type: AWS::Serverless::Function
+ Properties:
+ Description: A function that uses the arm64 runtime
+ CodeUri: function/ # Place your Powershell scripts/modules in this folder
+ Runtime: provided.al2
+ Architectures: [ arm64 ]
+ # Assuming you are using the 'script' method - ensure this script is in the folder named "function"
+ Handler: script.ps1
+ MemorySize: 1024
+ Timeout: 100
+ # Use CloudFormation's native support for SSM parameters to look up the latest version
+ Layers: [ '{{resolve:ssm:lambda-powershell-runtime-arm64-latest-version-arn}}' ]
+```
+
+## Cleanup
+
+To delete the AWS resources created, run the following and confirm that you want to delete the resources that were created by this template.
+````
+sam delete
+````
diff --git a/examples/reusable-pwsh-runtime/template.yml b/examples/reusable-pwsh-runtime/template.yml
new file mode 100644
index 0000000..6d4f9c9
--- /dev/null
+++ b/examples/reusable-pwsh-runtime/template.yml
@@ -0,0 +1,112 @@
+AWSTemplateFormatVersion: '2010-09-09'
+Transform: AWS::Serverless-2016-10-31
+Description: Demo for how to publish the PowerShell custom runtime for reuse.
+##########################################################################
+# Parameters & Globals #
+##########################################################################
+Parameters:
+ OrganizationId:
+ Type: String
+ Description: The ID of the Organization that will be granted access to the layers
+Resources:
+##########################################################################
+# Lambda layers #
+##########################################################################
+ PwshArm64RuntimeLayer:
+ Type: AWS::Serverless::LayerVersion
+ Properties:
+ LayerName: PwshRuntime-arm64
+ Description: Lambda Layer containing PowerShell
+ ContentUri: ../../powershell-runtime
+ CompatibleRuntimes:
+ - provided.al2
+ CompatibleArchitectures:
+ - arm64
+ RetentionPolicy: Delete
+ Metadata:
+ BuildMethod: makefile
+ PwshArm64RuntimeLayerPermission:
+ Type: AWS::Lambda::LayerVersionPermission
+ Properties:
+ Action: lambda:GetLayerVersion
+ LayerVersionArn: !Ref PwshArm64RuntimeLayer
+ OrganizationId: !Ref OrganizationId
+ Principal: "*"
+ PwshArm64RuntimeParameter:
+ Type: AWS::SSM::Parameter
+ Properties:
+ Name: lambda-powershell-runtime-arm64-latest-version-arn
+ Description: PwshRuntime arm64 layer ARN
+ Type: String
+ Value: !Ref PwshArm64RuntimeLayer
+
+ Pwshx64RuntimeLayer:
+ Type: AWS::Serverless::LayerVersion
+ Properties:
+ LayerName: PwshRuntime-x64
+ Description: Lambda Layer containing PowerShell
+ ContentUri: ../../powershell-runtime
+ CompatibleRuntimes:
+ - provided.al2
+ CompatibleArchitectures:
+ - x86_64
+ RetentionPolicy: Delete
+ Metadata:
+ BuildMethod: makefile
+ Pwshx64RuntimeLayerPermission:
+ Type: AWS::Lambda::LayerVersionPermission
+ Properties:
+ Action: lambda:GetLayerVersion
+ LayerVersionArn: !Ref Pwshx64RuntimeLayer
+ OrganizationId: !Ref OrganizationId
+ Principal: "*"
+ Pwshx64RuntimeParameter:
+ Type: AWS::SSM::Parameter
+ Properties:
+ Name: lambda-powershell-runtime-x64-latest-version-arn
+ Description: PwshRuntime x86_64 layer ARN
+ Type: String
+ Value: !Ref Pwshx64RuntimeLayer
+
+ AWSToolsCommonLayer:
+ Type: AWS::Serverless::LayerVersion
+ Properties:
+ LayerName: AWSToolsCommonLayer
+ Description: Layer containing AWS.Tools.Common module
+ ContentUri: ../../powershell-modules/AWSToolsforPowerShell/AWS.Tools.Common
+ CompatibleRuntimes:
+ - provided.al2
+ CompatibleArchitectures:
+ - x86_64
+ - arm64
+ RetentionPolicy: Delete
+ Metadata:
+ BuildMethod: makefile
+ AWSToolsCommonLayerPermission:
+ Type: AWS::Lambda::LayerVersionPermission
+ Properties:
+ Action: lambda:GetLayerVersion
+ LayerVersionArn: !Ref AWSToolsCommonLayer
+ OrganizationId: !Ref OrganizationId
+ Principal: "*"
+ AWSToolsCommonLayerParameter:
+ Type: AWS::SSM::Parameter
+ Properties:
+ Name: lambda-powershell-PSAWSTools-latest-version-arn
+ Description: AWS.Tools.Common layer ARN
+ Type: String
+ Value: !Ref AWSToolsCommonLayer
+
+##########################################################################
+# OUTPUTS #
+##########################################################################
+Outputs:
+ PwshArm64RuntimeLayer:
+ Value: !Ref PwshArm64RuntimeLayer
+ Description: PwshRuntime arm64 layer ARN
+ Pwshx64RuntimeLayer:
+ Value: !Ref Pwshx64RuntimeLayer
+ Description: PwshRuntime x86_64 layer ARN
+ PSAWSToolsLayer:
+ Value: !Ref AWSToolsCommonLayer
+ Description: AWSToolsCommonLayer Layer ARN
diff --git a/powershell-runtime/Makefile b/powershell-runtime/Makefile
index c71b2fb..228811e 100644
--- a/powershell-runtime/Makefile
+++ b/powershell-runtime/Makefile
@@ -1,6 +1,12 @@
-PWSH_VERSION ?= 7.2.4
-PWSH_ARCHITECTURE ?= x64
-#x64 or #arm64
+PWSH_VERSION ?= 7.2.7
+
+# Targets for x64 & arm64
+build-Pwshx64RuntimeLayer: PWSH_ARCHITECTURE = x64
+build-Pwshx64RuntimeLayer: build-PwshRuntimeLayer
+
+build-PwshArm64RuntimeLayer: PWSH_ARCHITECTURE = arm64
+build-PwshArm64RuntimeLayer: build-PwshRuntimeLayer
+
build-PwshRuntimeLayer:
# Download and extract PowerShell binaries. Remove downloaded file
curl -L -o $(ARTIFACTS_DIR)/powershell-$(PWSH_VERSION)-$(PWSH_ARCHITECTURE).tar.gz https://github.com/PowerShell/PowerShell/releases/download/v$(PWSH_VERSION)/powershell-$(PWSH_VERSION)-linux-$(PWSH_ARCHITECTURE).tar.gz
@@ -9,9 +15,7 @@ build-PwshRuntimeLayer:
rm $(ARTIFACTS_DIR)/powershell-$(PWSH_VERSION)-$(PWSH_ARCHITECTURE).tar.gz
# Make PowerShell binary executable
chmod +x $(ARTIFACTS_DIR)/powershell/pwsh
-
# Copy additional runtime files, including bootstrap. Remove Makefile from destination
cp -R ./pwsh-runtime/* $(ARTIFACTS_DIR)
-
# Make bootstrap script executable
- chmod +x $(ARTIFACTS_DIR)/bootstrap
\ No newline at end of file
+ chmod +x $(ARTIFACTS_DIR)/bootstrap