Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline installation steps of Azure PowerShell for Linux #2752

Closed
thiruma0203 opened this issue Sep 29, 2023 · 8 comments · Fixed by #2920
Closed

Offline installation steps of Azure PowerShell for Linux #2752

thiruma0203 opened this issue Sep 29, 2023 · 8 comments · Fixed by #2920
Assignees
Labels
azure-powershell/svc Service - azure-powershell/svc cxp doc-bug Issue - error in documentation issue-doc-enhancement Issue - doc enhancement request issue-doc-idea Issue - request for new content Pri1 Priority - High triaged

Comments

@thiruma0203
Copy link

Currently this documentation only has online install steps for Linux with Install-Module cmdlet.
As GitHub releases have .tar.gz package with Installmodule.PS1 in it, it seems to better to have offline installation steps as well.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@issues-automation issues-automation bot added azure-powershell/svc Service - azure-powershell/svc Pri1 Priority - High labels Sep 29, 2023
@RamanathanChinnappan-MSFT RamanathanChinnappan-MSFT added triaged doc-bug Issue - error in documentation cxp labels Sep 29, 2023
@RamanathanChinnappan-MSFT

@thiruma0203
I've delegated this to @mikefrobbins, a content author, to review and share their valuable insights.

@mikefrobbins mikefrobbins added issue-doc-idea Issue - request for new content issue-doc-enhancement Issue - doc enhancement request labels Sep 29, 2023
@mikefrobbins
Copy link
Contributor

@thiruma0203 I've added this suggestion as an idea for a future enhancement to our documentation.

@vivuu1989
Copy link

vivuu1989 commented Feb 25, 2024

Any solution on this? looking for a way to install azurepowerhell in Redhat 7.9 version offline where internet is not enabled.

@mikefrobbins
Copy link
Contributor

mikefrobbins commented Feb 26, 2024

@thiruma0203 and @vivuu1989, the steps to install the Az PowerShell module offline via the tar archive are:

These instructions work cross-platform on Windows, Linux, and macOS:

  1. Install PowerShell version 7.2 or higher
  2. Download the tar archive of the Az module from the Azure PowerShell source repo releases page.
  3. Copy the file to the offline system.
  4. Unblock the file if on Windows: Unblock-File -Path <file-path>
  5. Unarchive the tar file: tar zxf <tar-file-location> -C <destination-path>
  6. Run .<destination-path>/InstallModule.ps1 from PowerShell to install the Az module from the extracted files.

@vivuu1989
Copy link

6. InstallModule.ps1

Didnt Work. (Redhat version 7.9, pwsh installed version 7.2.18)

getting the below error

./InstallModule.ps1: line 1: syntax error near unexpected token newline' '/InstallModule.ps1: line 1: <#

removed the comment session as well, but again throwing the error

./InstallModule.ps1: line 3: $'.\r': command not found
./InstallModule.ps1: line 17: $'\r': command not found
./InstallModule.ps1: line 18: syntax error near unexpected token $']\r'' '/InstallModule.ps1: line 18: [cmdletbinding()]

@mikefrobbins
Copy link
Contributor

  1. InstallModule.ps1

Didnt Work. (Redhat version 7.9, pwsh installed version 7.2.18)

getting the below error

./InstallModule.ps1: line 1: syntax error near unexpected token newline' '/InstallModule.ps1: line 1: <#

removed the comment session as well, but again throwing the error

./InstallModule.ps1: line 3: $'.\r': command not found ./InstallModule.ps1: line 17: $'\r': command not found ./InstallModule.ps1: line 18: syntax error near unexpected token $']\r'' '/InstallModule.ps1: line 18: [cmdletbinding()]

You've launched PowerShell via pwsh, correct? I receive the same error when running ./InstallModule.ps1 from Bash.

@vivuu1989
Copy link

vivuu1989 commented Feb 27, 2024

  1. InstallModule.ps1

Didnt Work. (Redhat version 7.9, pwsh installed version 7.2.18)
getting the below error
./InstallModule.ps1: line 1: syntax error near unexpected token newline' '/InstallModule.ps1: line 1: <#
removed the comment session as well, but again throwing the error
./InstallModule.ps1: line 3: ′.\r′:commandnotfound./InstallModule.ps1:line17:'\r': command not found ./InstallModule.ps1: line 18: syntax error near unexpected token $']\r'' '/InstallModule.ps1: line 18: [cmdletbinding()]

You've launched PowerShell via pwsh, correct? I receive the same error when running ./InstallModule.ps1 from Bash.

Yes, I followed the instruction which you shared above and installed powershell in redhat machine using command
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell-7.4.1-1.rh.x86_64.rpm
So the offline installation is not possible in Linux ?

@mikefrobbins
Copy link
Contributor

mikefrobbins commented Feb 27, 2024

Offline installation is possible on Linux. Example of offline installation on RHEL 8.9 using the previously provided instructions:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-powershell/svc Service - azure-powershell/svc cxp doc-bug Issue - error in documentation issue-doc-enhancement Issue - doc enhancement request issue-doc-idea Issue - request for new content Pri1 Priority - High triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants