Skip to content

Conversation

bosesubham2011
Copy link
Contributor

@bosesubham2011 bosesubham2011 commented Jun 14, 2024

…on azure-linux

Fix #23944

PR Summary

This change will essentially allow PowerShell to be installed on Azure Linux boxes. As it is known that Azure Linux has a mariner base Distribution System, so it was only prudent to add the piece of code to allow for installation on Azure Linux boxes.

PR Context

This helps resolve - "install-powershell.sh doesn't work on azure-linux #23944" issue

PR Checklist

@@ -121,6 +121,9 @@ install(){
if [[ $osname = *SUSE* ]]; then
DistroBasedOn='suse'
REV=$(source /etc/os-release; echo $VERSION_ID)
elif [ $osname = *"Azure Linux"* ] ; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be [[ $osname = *"Azure Linux"* ]]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also maybe a better way would be to follow the same pattern above? eg:

   elif [ -f /etc/azurelinux-release ] ; then
                DistroBasedOn='mariner'
                PSUEDONAME=$( (sed s/.*\(// | sed s/\)//) < /etc/azurelinux-release )
                REV=$( (sed s/.*release\ // | sed s/\ .*//) < /etc/azurelinux-release )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is a better way to solve this issue.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried it and it doesn't work:

Get-PowerShell MASTER Installer Version 1.2.0
Installs PowerShell and Optional The Development Environment
Original script is at: https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools\install-powershell.psh
Arguments used:

Operating System Details:
OS: linux
DIST:
DistroBasedOn: mariner
PSUEDONAME: Azure Linux 3.0
AZURELINUX_BUILD_NUMBER=3.0.20240524
REV: Azure
AZURELINUX_BUILD_NUMBER=3.0.20240524
KERNEL: 6.6.29.1-3.azl3
MACH: x86_64
OSSTR:
Configuring PowerShell Environment for: mariner Azure
AZURELINUX_BUILD_NUMBER=3.0.20240524
Could not find "installpsh-mariner.sh" next to this script...
Pulling and executing it from "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/installpsh-mariner.sh"
found and using curl

*** PowerShell Development Environment Installer 1.2.0 for mariner
*** Original script is at: https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/installpsh-mariner.sh

*** Arguments used:

*** This installer is only for mariner and you are running , please run "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools\install-powershell.sh" to see if your distro is supported AND to auto-select the appropriate installer if it is.

@bosesubham2011 bosesubham2011 requested a review from dpoole73 June 15, 2024 18:39
@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Jun 25, 2024
Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@daxian-dbw daxian-dbw merged commit 4a0decb into PowerShell:master Jul 1, 2024
Copy link
Contributor

microsoft-github-policy-service bot commented Jul 1, 2024

📣 Hey @bosesubham2011, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Review - Needed The PR is being reviewed label Jul 1, 2024
@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Jul 1, 2024
chrisdent-de pushed a commit to chrisdent-de/PowerShell that referenced this pull request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

install-powershell.sh doesn't work on azure-linux
3 participants