Skip to content

Commit e2c4d76

Browse files
authored
Merge pull request #7392 from JeremyTBradshaw/patch-1
Add -Scope CurrentUser option for install/update
2 parents 815c134 + e755a57 commit e2c4d76

File tree

1 file changed

+51
-23
lines changed

1 file changed

+51
-23
lines changed

exchange/docs-conceptual/exchange-online-powershell-v2.md

Lines changed: 51 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -185,29 +185,43 @@ The EXO V2 module is supported in the following versions of Windows:
185185
186186
### Install the EXO V2 module
187187

188-
To install the EXO V2 module for the first time, complete the following steps **in an elevated PowerShell window**:
188+
To install the EXO V2 module for the first time, complete the following steps:
189189

190190
1. Install or update the PowerShellGet module as described in [Installing PowerShellGet](https://docs.microsoft.com/powershell/scripting/gallery/installing-psget).
191191

192-
2. Close and re-open the window.
192+
2. Close and re-open the Windows PowerShell window.
193193

194194
3. Now you can use the **Install-Module** cmdlet to install the EXO V2 module from the PowerShell Gallery. Typically, you'll want the latest public version of the module, but you can also install a Preview version if one is available.
195195

196-
- To install **the latest public version** of the module, run the following command:
196+
- To install **the latest public version** of the module, run **one** of the the following commands:
197197

198-
```powershell
199-
Install-Module -Name ExchangeOnlineManagement
200-
```
198+
- In an elevated PowerShell window (all users):
201199

202-
Enter **Y** to accept the license agreement.
200+
```powershell
201+
Install-Module -Name ExchangeOnlineManagement
202+
```
203203
204-
- To install **a Preview version** of the module, replace \<PreviewVersion\> with the necessary value, and run the following command:
204+
- Only for the current user account:
205205
206-
```powershell
207-
Install-Module -Name ExchangeOnlineManagement -RequiredVersion <PreviewVersion> -AllowPrerelease
208-
```
206+
```powershell
207+
Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser
208+
```
209209
210-
When you're finished, enter **Y** to accept the license agreement.
210+
- To install **a Preview version** of the module, replace \<PreviewVersion\> with the necessary value, and run **one** of the following commands:
211+
212+
- In an elevated PowerShell window (all users):
213+
214+
```powershell
215+
Install-Module -Name ExchangeOnlineManagement -RequiredVersion <PreviewVersion> -AllowPrerelease
216+
```
217+
218+
- Only for the current user account:
219+
220+
```powershell
221+
Install-Module -Name ExchangeOnlineManagement -RequiredVersion <PreviewVersion> -AllowPrerelease -Scope CurrentUser
222+
```
223+
224+
When you're finished, enter **Y** to accept the license agreement.
211225
212226
For detailed syntax and parameter information, see [Install-Module](https://docs.microsoft.com/powershell/module/powershellget/install-module).
213227
@@ -221,23 +235,37 @@ If the module is already installed on your computer, you can run the following c
221235
Import-Module ExchangeOnlineManagement; Get-Module ExchangeOnlineManagement
222236
```
223237

224-
2. You can use the **Update-Module** cmdlet **in an elevated PowerShell window** to update the EXO V2 module from the PowerShell Gallery. Typically, you'll want the latest public version of the module, but you can also upgrade to a Preview version if one is available.
238+
2. You can use the **Update-Module** cmdlet to update the EXO V2 module from the PowerShell Gallery. Typically, you'll want the latest public version of the module, but you can also upgrade to a Preview version if one is available.
239+
240+
- To upgrade to **the latest public version** of the module, run **one** of the following commands based on how you originally installed the module (in an elevated PowerShell window vs. `Scope CurrentUser`):
241+
242+
- In an elevated PowerShell window (all users):
243+
244+
```powershell
245+
Update-Module -Name ExchangeOnlineManagement
246+
```
247+
248+
- Only for the current user account:
249+
250+
```powershell
251+
Update-Module -Name ExchangeOnlineManagement -Scope CurrentUser
252+
```
225253
226-
- To upgrade to **the latest public version** of the module, run the following command:
254+
- To upgrade to **a Preview version** of the module, replace \<PreviewVersion\> with the necessary value, and run **one** of the following commands based on how you originally installed the module (in an elevated PowerShell window vs. `Scope CurrentUser`):
227255
228-
```powershell
229-
Update-Module -Name ExchangeOnlineManagement
230-
```
256+
- In an elevated PowerShell window (all users):
231257
232-
Enter **Y** to accept the license agreement.
258+
```powershell
259+
Update-Module -Name ExchangeOnlineManagement -RequiredVersion <PreviewVersion> -AllowPrerelease
260+
```
233261
234-
- To upgrade to **a Preview version** of the module, replace \<PreviewVersion\> with the necessary value, and run the following command:
262+
- Only for the current user account:
235263
236-
```powershell
237-
Update-Module -Name ExchangeOnlineManagement -RequiredVersion <PreviewVersion> -AllowPrerelease
238-
```
264+
```powershell
265+
Update-Module -Name ExchangeOnlineManagement -RequiredVersion <PreviewVersion> -AllowPrerelease -Scope CurrentUser
266+
```
239267
240-
When you're finished, enter **Y** to accept the license agreement.
268+
When you're finished, enter **Y** to accept the license agreement.
241269
242270
3. To confirm that the update was successful, run the following commands to check the version information of the module that's installed:
243271

0 commit comments

Comments
 (0)