Skip to content

Commit 05c37d4

Browse files
made the requested changes
1 parent c9f00d1 commit 05c37d4

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/powershell/install.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
2121
POWERSHELL_ARCHIVE_ARCHITECTURES_UBUNTU="amd64"
2222
POWERSHELL_ARCHIVE_ARCHITECTURES_ALMALINUX="x86_64"
2323
POWERSHELL_ARCHIVE_VERSION_CODENAMES="stretch buster bionic focal bullseye jammy bookworm noble"
24+
25+
#These key servers are used to verify the authenticity of packages and repositories.
26+
#keyservers for ubuntu and almalinux are different so we need to specify both
2427
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
2528
keyserver hkp://keyserver.ubuntu.com:80
2629
keyserver hkps://keys.openpgp.org
@@ -292,23 +295,18 @@ install_using_github() {
292295
if ! type git > /dev/null 2>&1; then
293296
check_packages git
294297
fi
295-
if [ "${architecture}" = "amd64" ]; then
298+
if [ "${architecture}" = "x86_64" ]; then
296299
architecture="amd64"
297-
elif [ "${architecture}" = "x86_64" ]; then
298-
architecture="x86_64"
299300
else
300-
architecture="x64"
301-
301+
architecture="x64"
302302
fi
303303
pwsh_url="https://github.com/PowerShell/PowerShell"
304304
find_version_from_git_tags POWERSHELL_VERSION $pwsh_url
305305
install_pwsh "${POWERSHELL_VERSION}"
306306
if grep -q "Not Found" "${powershell_filename}"; then
307307
install_prev_pwsh $pwsh_url
308308
fi
309-
310-
# Ugly - but only way to get sha256 is to parse release HTML. Remove newlines and tags, then look for filename followed by 64 hex characters.
311-
#curl -sSL -o "release.html" "https://github.com/PowerShell/PowerShell/releases/tag/v${POWERSHELL_VERSION}"
309+
312310
wget https://github.com/PowerShell/PowerShell/releases/download/v${POWERSHELL_VERSION}/${powershell_filename}
313311
mkdir ~/powershell
314312
tar -xvf powershell-${POWERSHELL_VERSION}-linux-x64.tar.gz -C ~/powershell

0 commit comments

Comments
 (0)