Skip to content

Commit 5f9295d

Browse files
authored
Merge pull request #48330 from mattbriggs/mdb_20180807_powershellquickstart1
PowerShell QuickStart
2 parents b08d0ea + 81e11f1 commit 5f9295d

File tree

6 files changed

+133
-175
lines changed

6 files changed

+133
-175
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26421,6 +26421,11 @@
2642126421
"redirect_url": "/azure/azure-stack/user/azure-stack-create-vm-template",
2642226422
"redirect_document_id": false
2642326423
},
26424+
{
26425+
"source_path": "articles/azure-stack/user/azure-stack-powershell-download.md",
26426+
"redirect_url": "/azure/azure-stack/azure-stack-powershell-download",
26427+
"redirect_document_id": false
26428+
},
2642426429
{
2642526430
"source_path": "articles/active-directory/application-proxy-teams.md",
2642626431
"redirect_url": "/azure/active-directory/manage-apps/application-proxy-integrate-with-teams",

articles/azure-stack/asdk/asdk-post-deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can use API version profiles to specify Azure Stack compatible AzureRM modu
3939
You can install the latest Azure Stack PowerShell module with or without Internet connectivity to the ASDK host computer:
4040

4141
> [!IMPORTANT]
42-
> Before installing the required version, make sure that you [uninstall any existing Azure PowerShell modules](.\.\azure-stack-powershell-install.md#uninstall-existing-versions-of-the-azure-stack-powershell-modules).
42+
> Before installing the required version, make sure that you [uninstall any existing Azure PowerShell modules](.\.\azure-stack-powershell-install.md#3-uninstall-existing-versions-of-the-azure-stack-powershell-modules).
4343
4444
- **With an internet connection** from the ASDK host computer. Run the following PowerShell script to install these modules on your development kit installation:
4545

articles/azure-stack/azure-stack-powershell-install.md

Lines changed: 89 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.workload: na
1212
pms.tgt_pltfrm: na
1313
ms.devlang: PowerShell
1414
ms.topic: article
15-
ms.date: 07/10/2018
15+
ms.date: 08/10/2018
1616
ms.author: mabrigg
1717
ms.reviewer: thoroet
1818
---
@@ -21,107 +21,137 @@ ms.reviewer: thoroet
2121

2222
*Applies to: Azure Stack integrated systems and Azure Stack Development Kit*
2323

24-
Azure Stack compatible Azure PowerShell modules are required to work with Azure Stack. In this guide, we walk you through the steps required to install PowerShell for Azure Stack. The following steps apply to internet connected environments. Scroll to the bottom of the page for disconnected environments.
24+
You will need to install Azure Stack compatible PowerShell modules to work with your cloud. Compatibility is enabled through a feature called *API profiles*.
2525

26-
This article has detailed instructions to install PowerShell for Azure Stack.
26+
API profiles provide a way to manage version differences between Azure and Azure Stack. An API version profile is a set of Azure Resource Manager PowerShell modules with specific API versions. Each cloud platform has a set of supported API version profiles. For example, Azure Stack supports a specific dated profile version such as **2017-03-09-profile**, and Azure supports the **latest** API version profile. When you install a profile, the Azure Resource Manager PowerShell modules that correspond to the specified profile are installed.
2727

28-
> [!Note]
29-
> The following steps require at least PowerShell 5.0. To check your version, run $PSVersionTable.PSVersion and compare the **Major** version. If you do not have PowerShell 5.0, follow the [link](https://docs.microsoft.com/en-us/powershell/scripting/setup/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell) to upgrade to PowerShell 5.0.
28+
You can install Azure Stack compatible PowerShell modules in Internet connected, partially connected, or in a disconnected scenario. In this article, we walk you through the detailed instructions to install PowerShell for Azure Stack for these scenarios.
3029

31-
PowerShell commands for Azure Stack are installed through the PowerShell Gallery. You can use the following procedure to validate if PSGallery is registered as a repository, open an elevated PowerShell session and run the following command:
30+
## 1. Verify your prerequisites
3231

33-
```PowerShell
34-
#requires -Version 5
35-
#requires -RunAsAdministrator
36-
#requires -Module PowerShellGet
32+
Before your get started with Azure Stack and PowerShell, you will need to have a few requirements in place.
3733

38-
Import-Module -Name PowerShellGet -ErrorAction Stop
39-
Import-Module -Name PackageManagement -ErrorAction Stop
34+
- **PowerShell Version 5.0**
35+
To check your version, run $PSVersionTable.PSVersion and compare the **Major** version. If you do not have PowerShell 5.0, follow the [link](https://docs.microsoft.com/powershell/scripting/setup/installing-windows-powershell?view=powershell-6#upgrading-existing-windows-powershell) to upgrade to PowerShell 5.0.
36+
37+
> [!Note]
38+
> PowerShell 5.0 requires a Windows machine.
39+
40+
- **Run Powershell an elevated prompt**
41+
You will need to be able to run PowerShell with administrative privileges.
42+
43+
- **PowerShell Gallery access**
44+
You will need access to the [PowerShell Gallery](https://www.powershellgallery.com). The gallery is the central repository for PowerShell content. The **PowerShellGet** module contains cmdlets for discovering, installing, updating, and publishing PowerShell artifacts such as modules, DSC resources, role capabilities, and scripts from the PowerShell Gallery and other private repositories. If you are using PowerShell in a disconnected scenario, you will need to retrieve resources from a machine with a connection to the Internet and store them in a location accessible to your disconnected machine.
45+
46+
47+
<!-- Nuget? -->
48+
49+
## 2. Validate if the PowerShell Gallery is accessible
50+
51+
Validate if PSGallery is registered as a repository.
52+
53+
> [!Note]
54+
> This step requires Internet access.
55+
56+
Open an elevated PowerShell prompt, and run the following cmdlets:
4057

58+
````PowerShell
59+
Import-Module -Name PowerShellGet -ErrorAction Stop
60+
Import-Module -Name PackageManagement -ErrorAction Stop
4161
Get-PSRepository -Name "PSGallery"
42-
```
62+
````
4363

4464
If the repository is not registered, open an elevated PowerShell session and run the following command:
4565

4666
```PowerShell
4767
Register-PsRepository -Default
4868
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
4969
```
50-
> [!Note]
51-
> This step requires Internet access.
5270

53-
## Uninstall existing versions of the Azure Stack PowerShell modules
71+
## 3. Uninstall existing versions of the Azure Stack PowerShell modules
5472

5573
Before installing the required version, make sure that you uninstall any previously installed Azure Stack AzureRM PowerShell modules. You can uninstall them by using one of the following two methods:
5674

57-
- To uninstall the existing AzureStack and AzureRM PowerShell modules, close all the active PowerShell sessions and run the following command:
75+
1. To uninstall the existing AzureRM PowerShell modules, close all the active PowerShell sessions, and run the following cmdlets:
76+
77+
````PowerShell
78+
Uninstall-Module AzureRM.AzureStackAdmin -Force
79+
Uninstall-Module AzureRM.AzureStackStorage -Force
80+
Uninstall-Module -Name AzureStack -Force
81+
````
5882

59-
```PowerShell
60-
Uninstall-Module -Name AzureStack -Force -Verbose
61-
Uninstall-Module -Name AzureRM.AzureStackAdmin -Force -Verbose
62-
Uninstall-Module -Name AzureRM.AzureStackStorage -Force -Verbose
63-
Get-Module -ListAvailable | Where Name -Like "Azs.*" | Uninstall-Module -Force -Verbose
64-
```
83+
2. Delete all the folders that start with `Azure` from the `C:\Program Files\WindowsPowerShell\Modules` and `C:\Users\AzureStackAdmin\Documents\WindowsPowerShell\Modules` folders. Deleting these folders removes any existing PowerShell modules.
6584

66-
- Delete all the folders that start with "Azure" from the `C:\Program Files\WindowsPowerShell\Modules` and `C:\Users\AzureStackAdmin\Documents\WindowsPowerShell\Modules` folders. Deleting these folders removes any existing PowerShell modules.
85+
## 4. Connected: Install PowerShell for Azure Stack with Internet connectivity
6786

68-
The following sections describe the steps required to install PowerShell for Azure Stack. PowerShell can be installed on Azure Stack that is operated in connected, partially connected, or in a disconnected scenario.
87+
Azure Stack requires the **2017-03-09-profile** API version profile, which is available by installing the **AzureRM.Bootstrapper** module. In addition to the AzureRM modules, you should also install the Azure Stack-specific PowerShell modules.
6988

70-
## Install the Azure Stack PowerShell modules in a connected scenario (with Internet connectivity)
89+
Run the following PowerShell script to install these modules on your development workstation:
7190

72-
Azure Stack compatible AzureRM modules are installed through API version profiles. Azure Stack requires the **2017-03-09-profile** API version profile, which is available by installing the AzureRM.Bootstrapper module. To learn about API version profiles and the cmdlets provided by them, refer to the [manage API version profiles](user/azure-stack-version-profiles.md). In addition to the AzureRM modules, you should also install the Azure Stack-specific PowerShell modules. Run the following PowerShell script to install these modules on your development workstation:
91+
- **Version 1.4.0** (Azure Stack 1804 or greater)
7392

74-
```PowerShell
75-
# Install the AzureRM.Bootstrapper module. Select Yes when prompted to install NuGet
76-
Install-Module -Name AzureRm.BootStrapper
93+
```PowerShell
94+
# Install the AzureRM.Bootstrapper module. Select Yes when prompted to install NuGet
95+
Install-Module -Name AzureRm.BootStrapper
7796
78-
# Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
79-
Use-AzureRmProfile -Profile 2017-03-09-profile -Force
97+
# Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
98+
Use-AzureRmProfile -Profile 2017-03-09-profile -Force
8099
81-
# Install Module Version 1.4.0 if Azure Stack is running 1804 at a minimum
82-
Install-Module -Name AzureStack -RequiredVersion 1.4.0
100+
# Install Module Version 1.4.0 if Azure Stack is running 1804 at a minimum
101+
Install-Module -Name AzureStack -RequiredVersion 1.4.0
102+
```
83103
84-
# Install Module Version 1.2.11 if Azure Stack is running a lower version than 1804
85-
Install-Module -Name AzureStack -RequiredVersion 1.2.11
86-
```
104+
- **Version 1.2.11** (before 1804)
87105
88-
To confirm the installation, run the following command:
106+
```PowerShell
107+
# Install the AzureRM.Bootstrapper module. Select Yes when prompted to install NuGet
108+
Install-Module -Name AzureRm.BootStrapper
109+
110+
# Install and import the API Version Profile required by Azure Stack into the current PowerShell session.
111+
Use-AzureRmProfile -Profile 2017-03-09-profile -Force
112+
113+
# Install Module Version 1.2.11 if Azure Stack is running a lower version than 1804
114+
Install-Module -Name AzureStack -RequiredVersion 1.2.11
115+
```
116+
117+
Confirm the installation by running the following command:
89118
90119
```PowerShell
91120
Get-Module -ListAvailable | where-Object {$_.Name -like "Azs*"}
92121
```
93122

94123
If the installation is successful, the AzureRM and AzureStack modules are displayed in the output.
95124

96-
## Install the Azure Stack PowerShell modules in a disconnected or a partially connected scenario (with limited Internet connectivity)
125+
## 5. Disconnected: Install PowerShell without an Internet connection
97126

98127
In a disconnected scenario, you must first download the PowerShell modules to a machine that has Internet connectivity, and then transfer them to the Azure Stack Development Kit for installation.
99128

100-
> [!IMPORTANT]
101-
> The release of 1.4.0 AzureStack module does not have any breaking changes with the earlier version 1.3.0. Please refer to the [release notes](https://aka.ms/azspsh140release) for the changes in release 1.4.0. However the version 1.3.0 of AzureStack module has a list of breaking changes. To upgrade from the 1.2.11 version, see the [migration guide](https://aka.ms/azspowershellmigration).
129+
Sign in to a computer where you have Internet connectivity and use the following scripts to download the Azure Resource Manager and AzureStack packages onto your local computer depending on your version of Azure Stack.
102130

103-
1. Sign in to a computer where you have internet connectivity and use the following script to download the AzureRM, and AzureStack packages onto your local computer:
104131

105-
```PowerShell
106-
#requires -Version 5
107-
#requires -RunAsAdministrator
108-
#requires -Module PowerShellGet
109-
#requires -Module PackageManagement
132+
- **Version 1.3.0** (Azure Stack 1804 or greater)
110133

111-
Import-Module -Name PowerShellGet -ErrorAction Stop
112-
Import-Module -Name PackageManagement -ErrorAction Stop
134+
> [!Note]
135+
To upgrade from the 1.2.11 version, see the [migration guide](https://aka.ms/azspowershellmigration).
113136

114-
$Path = "<Path that is used to save the packages>"
137+
````PowerShell
138+
Import-Module -Name PowerShellGet -ErrorAction Stop
139+
Import-Module -Name PackageManagement -ErrorAction Stop
115140
116-
Save-Package -ProviderName NuGet -Source https://www.powershellgallery.com/api/v2 `
117-
-Name AzureRM -Path $Path -Force -RequiredVersion 1.2.11
141+
$Path = "<Path that is used to save the packages>"
142+
Save-Package -ProviderName NuGet -Source https://www.powershellgallery.com/api/v2 -Name AzureStack -Path $Path -Force -RequiredVersion 1.4.0
143+
````
118144
119-
Save-Package -ProviderName NuGet -Source https://www.powershellgallery.com/api/v2 `
120-
-Name AzureStack -Path $Path -Force -RequiredVersion 1.4.0
121-
```
145+
- **Version 1.2.11** (before 1804)
146+
147+
````PowerShell
148+
Import-Module -Name PowerShellGet -ErrorAction Stop
149+
Import-Module -Name PackageManagement -ErrorAction Stop
150+
151+
$Path = "<Path that is used to save the packages>"
122152
123-
> [!Important]
124-
> If you are not running Azure Stack with update 1804 or greater, change the **requiredversion** parameter value to `1.2.11`.
153+
Save-Package -ProviderName NuGet -Source https://www.powershellgallery.com/api/v2 -Name AzureRM -Path $Path -Force -RequiredVersion 1.2.11
154+
````
125155
126156
2. Copy the downloaded packages over to a USB device.
127157
@@ -145,9 +175,9 @@ In a disconnected scenario, you must first download the PowerShell modules to a
145175
Install-Module AzureStack -Repository $RepoName
146176
```
147177
148-
## Configure PowerShell to use a proxy server
178+
## 6. Configure PowerShell to use a proxy server
149179
150-
In scenarios that require a proxy server to access the internet, you must first configure the PowerShell to use an existing proxy server.
180+
In scenarios that require a proxy server to access the Internet, you must first configure the PowerShell to use an existing proxy server.
151181
152182
1. Open an elevated PowerShell prompt.
153183
2. Run the following commands:

articles/azure-stack/user/TOC.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@
112112
- name: Install Azure Stack PowerShell
113113
href: ../azure-stack-powershell-install.md
114114
maintainContext: true
115-
- name: Download Azure Stack tools
116-
href: azure-stack-powershell-download.md
117-
- name: Configure PowerShell - User
115+
- name: Configure PowerShell
118116
href: azure-stack-powershell-configure-user.md
117+
- name: Download Azure Stack tools
118+
href: ../azure-stack-powershell-download.md
119+
maintainContext: true
119120
- name: Install Visual Studio
120121
href: azure-stack-install-visual-studio.md
121122
- name: Using API version profiles
@@ -154,7 +155,9 @@
154155
- name: Reference
155156
items:
156157
- name: Azure Stack PowerShell
157-
href: /powershell/azure/azure-stack/overview?view=azurestackps-1.2.10
158+
href: /powershell/azure/azure-stack/overview?view=azurestackps-1.3.0
159+
- name: Azure Stack REST API Browser
160+
href: /rest/api/
158161
- name: Azure Stack CLI
159162
href: /cli/azure/reference-index?view=azure-cli-2017-03-09-profile
160163
- name: Related

0 commit comments

Comments
 (0)