In some environments, it's not possible to connect to the internet or the PowerShell Gallery. In
those situations, you can install the Az PowerShell module offline using one of these methods.
Бележка
The options for offline installation in this article require at least one system with internet
access to download the Az PowerShell module, which can be different from the system where you
plan to install the module.
Windows PowerShell 5.1 is also supported if your're running a Windows operating system.
Cross platform
The following installation options for the Az PowerShell module are available cross-platform on all
platforms including Windows, Linux, and macOS.
Install from tar archive
Съвет
The tar command-line utility is required to use this installation option. Its available by
default on Windows 10 version 1803 or higher, most Linux distributions, and current versions of
macOS.
On a system with access to the internet, define the destination path where you want to save the
tar archive.
PowerShell
$downloadFolderPath = "$home/Downloads"
Verify the download folder exists. Create the folder otherwise.
Unblock the downloaded file if you're running a Windows operating system.
PowerShell
if ($PSVersionTable.PSVersion.Major -le5 -or$IsWindows -eq$true) {
Unblock-File -Path$downloadFilePath
}
Бележка
Copy the tar archive to your offline system. Define the $downloadFilePath and
$downloadFolderPath variables or specify actual values instead of using the variables in the
following commands on your offline system.
Extract the contents of the tar archive.
PowerShell
tar zxf $downloadFilePath -C$downloadFolderPath
Run the InstallModule.ps1 script that's one of the extracted files on the offline system where
you want to install the Az PowerShell module.
PowerShell
.$downloadFolderPath/InstallModule.ps1
Save and copy installation
Download the Az PowerShell module with Save-Module or Save-PSResource to a network location
using a system with access to the internet and the PowerShell Gallery. These commands save the Az
module and its dependencies to the specified location. Use the saved modules as the installation
source and copy them to the offline system.
This method allows you to cache PowerShell modules on a single server or file share to be deployed
with PowerShellGet or Microsoft.PowerShell.PSResourceGet to any disconnected systems.
Windows
On Windows, you also have the option of installing the Az PowerShell module with an MSI if you're
using Windows PowerShell version 5.1.
Важно
Keep in mind that the MSI installer only works for Windows PowerShell 5.1.
Източникът за това съдържание може да бъде намерен в GitHub, където можете също да създавате и преглеждате проблеми и да изтегляте искания. За повече информация вижте нашето ръководство за сътрудник.
Обратна връзка за Azure PowerShell
Azure PowerShell е проект с отворен код. Изберете връзка, за да предоставите обратна връзка:
This module explains the Azure PowerShell environment and the Az module for Windows PowerShell. It also explains how to manage Microsoft Entra ID by using PowerShell modules.