1
1
---
2
2
description : Information about installing PowerShell on macOS
3
- ms.date : 04/29 /2025
3
+ ms.date : 06/18 /2025
4
4
title : Installing PowerShell on macOS
5
5
---
6
6
7
7
# Installing PowerShell on macOS
8
8
9
- PowerShell 7 or higher requires macOS 11 and higher. All packages are available on our GitHub
10
- [ releases] [ 09 ] page. After the package is installed, run ` pwsh ` from a terminal. Before installing,
11
- check the list of [ Supported versions] [ 06 ] below .
9
+ PowerShell 7 or higher requires macOS 13 and higher. All packages are available on the GitHub
10
+ [ releases] [ 09 ] page for PowerShell . After the package is installed, run ` pwsh ` from a terminal.
11
+ Before installing, check the list of [ Supported versions] [ 06 ] .
12
12
13
13
> [ !NOTE]
14
- > PowerShell 7.4 is an in-place upgrade that removes previous versions of PowerShell 7. Preview
15
- > versions of PowerShell can be installed side-by-side with other versions of PowerShell. If you
16
- > need to run PowerShell 7.4 side-by-side with a previous version, reinstall the previous version
17
- > using the [ binary archive] [ 04 ] method.
14
+ > PowerShell 7.4 is an in-place upgrade that removes previous versions of PowerShell 7. You can
15
+ > install preview versions of PowerShell side-by-side with other versions of PowerShell. If you need
16
+ > to run PowerShell 7.4 side-by-side with a previous version, reinstall the previous version using
17
+ > the [ binary archive] [ 04 ] method.
18
18
19
19
[ !INCLUDE [ Latest version] ( ../../includes/latest-install.md )]
20
20
@@ -23,7 +23,7 @@ check the list of [Supported versions][06] below.
23
23
There are several ways to install PowerShell on macOS. Choose one of the following methods:
24
24
25
25
- Install using [ Homebrew] [ 10 ] . Homebrew is the preferred package manager for macOS.
26
- - Install PowerShell via [ Direct Download] [ 04 ]
26
+ - Install via [ Direct Download] [ 04 ]
27
27
- Install from [ binary archives] [ 03 ] .
28
28
29
29
If the ` brew ` command isn't found, you need to install Homebrew following [ their instructions] [ 10 ] .
@@ -32,15 +32,15 @@ If the `brew` command isn't found, you need to install Homebrew following [their
32
32
/bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
33
33
```
34
34
35
- Once ` brew ` is installed you can install PowerShell.
35
+ Once ` brew ` is installed, install PowerShell.
36
36
37
37
The following command installs the latest stable release of PowerShell:
38
38
39
39
``` sh
40
40
brew install --cask powershell
41
41
```
42
42
43
- Finally, verify that your install is working properly :
43
+ Verify the installation is working correctly :
44
44
45
45
``` sh
46
46
pwsh
@@ -54,15 +54,15 @@ brew upgrade powershell
54
54
```
55
55
56
56
> [ !NOTE]
57
- > The commands above can be called from within a PowerShell (pwsh) host , but then the PowerShell
58
- > shell must be exited and restarted to complete the upgrade and refresh the values shown in
57
+ > You can call the previous commands from within a PowerShell (` pwsh ` ) session , but then you must
58
+ > restart the PowerShell session to complete the upgrade and refresh the values shown in
59
59
> ` $PSVersionTable ` .
60
60
61
61
[ brew ] : https://brew.sh/
62
62
63
63
## Install the latest preview release of PowerShell
64
64
65
- After you've installed Homebrew, you can install PowerShell.
65
+ The following command installs the latest preview release of PowerShell:
66
66
67
67
``` sh
68
68
brew install powershell/tap/powershell-preview
@@ -74,105 +74,128 @@ Run the following command to start the preview version of PowerShell:
74
74
pwsh-preview
75
75
```
76
76
77
- When new versions of PowerShell are released, update Homebrew's formulae and upgrade PowerShell:
77
+ When new preview versions of PowerShell are released, update Homebrew's formulae and upgrade to the
78
+ latest preview version of PowerShell:
78
79
79
80
``` sh
80
81
brew update
81
82
brew upgrade powershell-preview
82
83
```
83
84
84
85
> [ !NOTE]
85
- > The commands above can be called from within a PowerShell (pwsh) host , but then the PowerShell
86
- > shell must be exited and restarted to complete the upgrade. and refresh the values shown in
86
+ > You can call the previous commands from within a PowerShell (` pwsh ` ) session , but then you must
87
+ > restart the PowerShell session to complete the upgrade and refresh the values shown in
87
88
> ` $PSVersionTable ` .
88
89
89
90
## Install the latest LTS release of PowerShell
90
91
92
+ The following command installs the latest LTS release of PowerShell:
93
+
91
94
``` sh
92
95
brew install powershell/tap/powershell-lts
93
96
```
94
97
95
- You can now verify your install
98
+ Verify your installation:
96
99
97
100
``` sh
98
101
pwsh-lts
99
102
```
100
103
101
- When new versions of PowerShell are released, run the following command.
104
+ When new LTS versions of PowerShell are released, run the following commands to update Homebrew's
105
+ formulae and upgrade to the latest LTS version of PowerShell:
102
106
103
107
``` sh
108
+ brew update
104
109
brew upgrade powershell-lts
105
110
```
106
111
107
112
> [ !NOTE]
108
- > Whether you use the cask or the tap method, when updating to a newer version of PowerShell, use
109
- > the same method you used to initially install PowerShell . If you use a different method, opening a
110
- > new pwsh session will continue to use the older version of PowerShell.
113
+ > When updating to a newer version of PowerShell, use the same method, cask or the tap, that you
114
+ > used to perform the initial install . If you use a different method, opening a new pwsh session
115
+ > continues to use the older version of PowerShell.
111
116
>
112
- > If you do decide to use different methods, there are ways to correct the issue using the
117
+ > If you decide to use different methods, there are ways to correct the issue using the
113
118
> [ Homebrew link method] [ 11 ] .
114
119
115
120
## Installation via Direct Download
116
121
117
122
Starting with version 7.2, PowerShell supports the Apple M-series Arm-based processors. Download the
118
- install package from the [ releases] [ 09 ] page onto your computer. The links to the current versions
119
- are:
123
+ install package from the [ releases] [ 09 ] page onto your Mac. The links to the current versions are:
120
124
121
- - PowerShell 7.4
122
- - x64 processors - [ powershell-7.4.10-osx-x64.pkg] [ 20 ]
123
- - Arm64 processors - [ powershell-7.4.10-osx-arm64.pkg] [ 18 ]
124
125
- PowerShell 7.5
125
- - x64 processors - [ powershell-7.5.1-osx-x64.pkg] [ 24 ]
126
126
- Arm64 processors - [ powershell-7.5.1-arm64.pkg] [ 22 ]
127
+ - x64 processors - [ powershell-7.5.1-osx-x64.pkg] [ 24 ]
128
+
129
+ - PowerShell 7.4
130
+ - Arm64 processors - [ powershell-7.4.10-osx-arm64.pkg] [ 18 ]
131
+ - x64 processors - [ powershell-7.4.10-osx-x64.pkg] [ 20 ]
132
+
133
+ There are two ways to install PowerShell using the Direct Download method.
134
+
135
+ ### Using Finder
127
136
128
- You can double-click the file and follow the prompts, or install it from the terminal using the
129
- following commands. Change the name of the file to match the file you downloaded.
137
+ Install PowerShell using Finder:
138
+
139
+ 1 . Open Finder
140
+ 1 . Locate the downloaded package
141
+ 1 . Double-click the file
142
+ 1 . Follow the prompts
143
+
144
+ You might receive the following error message when installing the package:
145
+
146
+ > "powershell-7.5.1-osx-arm64.pkg" cannot be opened because Apple cannot check it for malicious
147
+ > software.
148
+
149
+ To work around this issue using Finder:
150
+
151
+ 1 . Locate the downloaded package in Finder
152
+ 1 . Control-click (click while pressing the <kbd >Control (or Ctrl)</kbd > key on the package
153
+ 1 . Select ** Open** from the context menu
154
+
155
+ ### Using Terminal
156
+
157
+ Install PowerShell from the terminal. Change the filename to match the package you downloaded.
130
158
131
159
``` sh
132
- sudo installer -pkg ./Downloads/powershell-7.5.1-osx-x64 .pkg -target /
160
+ sudo installer -pkg ./Downloads/powershell-7.5.1-osx-arm64 .pkg -target /
133
161
```
134
162
135
- If you are running on macOS Big Sur 11.5 or higher you may receive the following error message
136
- when installing the package:
163
+ You might receive the following error message when installing the package:
137
164
138
- > "powershell-7.5.1-osx-x64 .pkg" cannot be opened because Apple cannot check it for malicious
165
+ > "powershell-7.5.1-osx-arm64 .pkg" cannot be opened because Apple cannot check it for malicious
139
166
> software.
140
167
141
- There are two ways to work around this issue:
168
+ There are a few different ways to work around this issue from the command line :
142
169
143
- Using the Finder
170
+ - Run the ` installer ` command with the ** allowUntrusted ** flag:
144
171
145
- 1 . Find the package in Finder.
146
- 1 . Control-click (click while pressing the < kbd >Ctrl</ kbd > key) on the package.
147
- 1 . Select ** Open ** from the context menu.
172
+ ``` sh
173
+ ` sudo installer -allowUntrusted -pkg ./Downloads/powershell-7.5.1-osx-arm64.pkg -target / `
174
+ ```
148
175
149
- From the command line
176
+ - Or install the package as you normally would after running one of the following commands:
150
177
151
- 1 . Run ` sudo xattr -rd com.apple.quarantine ./Downloads/powershell-7.5.1-osx-x64.pkg ` . If you are using
152
- PowerShell 7 or higher, you can use the ` Unblock-File ` cmdlet. Include the full path to the
153
- ` .pkg ` file.
154
- 1 . Install the package as you normally would.
155
-
156
- > [ !NOTE]
157
- > This is a known issue related to package notarization that will be addressed in the future.
178
+ - Run ` sudo xattr -rd com.apple.quarantine ./Downloads/powershell-7.5.1-osx-arm64.pkg ` .
179
+ - Use the ` Unblock-File ` cmdlet if you're using PowerShell. Include the full path to the ` .pkg `
180
+ file.
158
181
159
182
## Install as a .NET Global tool
160
183
161
184
If you already have the [ .NET Core SDK] [ 01 ] installed, it's easy to install PowerShell as a
162
185
[ .NET Global tool] [ 02 ] .
163
186
164
- ```
187
+ ``` sh
165
188
dotnet tool install --global PowerShell
166
189
```
167
190
168
191
The dotnet tool installer adds ` ~/.dotnet/tools ` to your ` PATH ` environment variable. However, the
169
- currently running shell doesn't have the updated ` PATH ` . You should be able to start PowerShell from
170
- a new shell by typing ` pwsh ` .
192
+ currently running shell doesn't have the updated ` PATH ` . Start PowerShell from a new shell by typing
193
+ ` pwsh ` .
171
194
172
195
## Binary Archives
173
196
174
197
PowerShell binary ` tar.gz ` archives are provided for the macOS platform to enable advanced
175
- deployment scenarios. When you install using this method you must also manually install any
198
+ deployment scenarios. When you install using this method, you must also manually install any
176
199
dependencies.
177
200
178
201
> [ !NOTE]
@@ -184,22 +207,23 @@ dependencies.
184
207
185
208
### Installing binary archives on macOS
186
209
187
- Download the install package from the [ releases] [ 09 ] page onto your computer . The links to the
188
- current versions are:
210
+ Download the install package from the [ releases] [ 09 ] page onto your Mac . The links to the current
211
+ versions are:
189
212
190
- - PowerShell 7.4 (LTS)
191
- - x64 processors - [ powershell-7.4.10-osx-x64.tar.gz] [ 21 ]
192
- - Arm64 processors - [ powershell-7.4.10-osx-arm64.tar.gz] [ 19 ]
193
213
- PowerShell 7.5-preview
194
- - x64 processors - [ powershell-7.5.1-osx-x64.tar.gz] [ 25 ]
195
214
- Arm64 processors - [ powershell-7.5.1-osx-arm64.tar.gz] [ 23 ]
215
+ - x64 processors - [ powershell-7.5.1-osx-x64.tar.gz] [ 25 ]
216
+
217
+ - PowerShell 7.4 (LTS)
218
+ - Arm64 processors - [ powershell-7.4.10-osx-arm64.tar.gz] [ 19 ]
219
+ - x64 processors - [ powershell-7.4.10-osx-x64.tar.gz] [ 21 ]
196
220
197
221
Use the following commands to install PowerShell from the binary archive. Change the download URL to
198
222
match the version you want to install.
199
223
200
224
``` sh
201
225
# Download the powershell '.tar.gz' archive
202
- curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.5.1/powershell-7.5.1-osx-x64 .tar.gz
226
+ curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.5.1/powershell-7.5.1-osx-arm64 .tar.gz
203
227
204
228
# Create the target folder where powershell is placed
205
229
sudo mkdir -p /usr/local/microsoft/powershell/7
@@ -228,11 +252,11 @@ If you installed PowerShell via direct download, PowerShell must be removed manu
228
252
sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
229
253
```
230
254
231
- To remove the additional PowerShell paths, refer to the [ paths] [ 05 ] section in this document and
232
- remove the paths using ` sudo rm ` .
255
+ To remove the extra PowerShell paths, refer to the [ paths] [ 05 ] section in this document and remove
256
+ the paths using ` sudo rm ` .
233
257
234
258
> [ !NOTE]
235
- > This isn't necessary if you installed with Homebrew.
259
+ > This process isn't necessary if you installed with Homebrew.
236
260
237
261
## Paths
238
262
@@ -244,7 +268,7 @@ remove the paths using `sudo rm`.
244
268
- User modules are read from ` ~/.local/share/powershell/Modules `
245
269
- Shared modules are read from ` /usr/local/share/powershell/Modules `
246
270
- Default modules are read from ` $PSHOME/Modules `
247
- - PSReadLine history are recorded to ` ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt `
271
+ - PSReadLine history is recorded to ` ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt `
248
272
249
273
PowerShell respects the [ XDG Base Directory Specification] [ 26 ] on macOS.
250
274
@@ -254,8 +278,8 @@ PowerShell respects the [XDG Base Directory Specification][26] on macOS.
254
278
255
279
## Installation support
256
280
257
- Microsoft supports the installation methods in this document. There may be other methods of
258
- installation available from other sources. While those tools and methods may work, Microsoft can't
281
+ Microsoft supports the installation methods in this document. There might be other methods of
282
+ installation available from other sources. While those tools and methods might work, Microsoft can't
259
283
support those methods.
260
284
261
285
## Additional Resources
0 commit comments