Skip to content

Commit b4b0619

Browse files
authored
Fixes 12151 - Added allowUntrusted flag (#12159)
1 parent 61cec15 commit b4b0619

File tree

1 file changed

+89
-65
lines changed

1 file changed

+89
-65
lines changed

reference/docs-conceptual/install/Installing-PowerShell-on-macOS.md

Lines changed: 89 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
22
description: Information about installing PowerShell on macOS
3-
ms.date: 04/29/2025
3+
ms.date: 06/18/2025
44
title: Installing PowerShell on macOS
55
---
66

77
# Installing PowerShell on macOS
88

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].
1212

1313
> [!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.
1818
1919
[!INCLUDE [Latest version](../../includes/latest-install.md)]
2020

@@ -23,7 +23,7 @@ check the list of [Supported versions][06] below.
2323
There are several ways to install PowerShell on macOS. Choose one of the following methods:
2424

2525
- 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]
2727
- Install from [binary archives][03].
2828

2929
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
3232
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3333
```
3434

35-
Once `brew` is installed you can install PowerShell.
35+
Once `brew` is installed, install PowerShell.
3636

3737
The following command installs the latest stable release of PowerShell:
3838

3939
```sh
4040
brew install --cask powershell
4141
```
4242

43-
Finally, verify that your install is working properly:
43+
Verify the installation is working correctly:
4444

4545
```sh
4646
pwsh
@@ -54,15 +54,15 @@ brew upgrade powershell
5454
```
5555

5656
> [!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
5959
> `$PSVersionTable`.
6060
6161
[brew]: https://brew.sh/
6262

6363
## Install the latest preview release of PowerShell
6464

65-
After you've installed Homebrew, you can install PowerShell.
65+
The following command installs the latest preview release of PowerShell:
6666

6767
```sh
6868
brew install powershell/tap/powershell-preview
@@ -74,105 +74,128 @@ Run the following command to start the preview version of PowerShell:
7474
pwsh-preview
7575
```
7676

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:
7879

7980
```sh
8081
brew update
8182
brew upgrade powershell-preview
8283
```
8384

8485
> [!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
8788
> `$PSVersionTable`.
8889
8990
## Install the latest LTS release of PowerShell
9091

92+
The following command installs the latest LTS release of PowerShell:
93+
9194
```sh
9295
brew install powershell/tap/powershell-lts
9396
```
9497

95-
You can now verify your install
98+
Verify your installation:
9699

97100
```sh
98101
pwsh-lts
99102
```
100103

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:
102106

103107
```sh
108+
brew update
104109
brew upgrade powershell-lts
105110
```
106111

107112
> [!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.
111116
>
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
113118
> [Homebrew link method][11].
114119
115120
## Installation via Direct Download
116121

117122
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:
120124

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]
124125
- PowerShell 7.5
125-
- x64 processors - [powershell-7.5.1-osx-x64.pkg][24]
126126
- 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
127136

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.
130158

131159
```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 /
133161
```
134162

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:
137164

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
139166
> software.
140167
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:
142169

143-
Using the Finder
170+
- Run the `installer` command with the **allowUntrusted** flag:
144171

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+
```
148175

149-
From the command line
176+
- Or install the package as you normally would after running one of the following commands:
150177

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.
158181

159182
## Install as a .NET Global tool
160183

161184
If you already have the [.NET Core SDK][01] installed, it's easy to install PowerShell as a
162185
[.NET Global tool][02].
163186

164-
```
187+
```sh
165188
dotnet tool install --global PowerShell
166189
```
167190

168191
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`.
171194

172195
## Binary Archives
173196

174197
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
176199
dependencies.
177200

178201
> [!NOTE]
@@ -184,22 +207,23 @@ dependencies.
184207
185208
### Installing binary archives on macOS
186209

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:
189212

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]
193213
- PowerShell 7.5-preview
194-
- x64 processors - [powershell-7.5.1-osx-x64.tar.gz][25]
195214
- 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]
196220

197221
Use the following commands to install PowerShell from the binary archive. Change the download URL to
198222
match the version you want to install.
199223

200224
```sh
201225
# 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
203227

204228
# Create the target folder where powershell is placed
205229
sudo mkdir -p /usr/local/microsoft/powershell/7
@@ -228,11 +252,11 @@ If you installed PowerShell via direct download, PowerShell must be removed manu
228252
sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
229253
```
230254

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`.
233257

234258
> [!NOTE]
235-
> This isn't necessary if you installed with Homebrew.
259+
> This process isn't necessary if you installed with Homebrew.
236260
237261
## Paths
238262

@@ -244,7 +268,7 @@ remove the paths using `sudo rm`.
244268
- User modules are read from `~/.local/share/powershell/Modules`
245269
- Shared modules are read from `/usr/local/share/powershell/Modules`
246270
- 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`
248272

249273
PowerShell respects the [XDG Base Directory Specification][26] on macOS.
250274

@@ -254,8 +278,8 @@ PowerShell respects the [XDG Base Directory Specification][26] on macOS.
254278

255279
## Installation support
256280

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
259283
support those methods.
260284

261285
## Additional Resources

0 commit comments

Comments
 (0)