Skip to content

Commit c8213e1

Browse files
committed
Improve Windows docs
1 parent 1690634 commit c8213e1

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Diff for: src/building/how-to-build-and-run.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ Some alternative ways are:
7272
# On a Unix shell if you don't have the necessary `python3` command
7373
./x <subcommand> [flags]
7474

75-
# On Windows (if powershell is configured to run scripts)
75+
# In Windows Powershell (if powershell is configured to run scripts)
76+
./x <subcommand> [flags]
7677
./x.ps1 <subcommand> [flags]
7778

7879
# On the Windows Command Prompt (if .py files are configured to run Python)
@@ -82,7 +83,24 @@ x.py <subcommand> [flags]
8283
python x.py <subcommand> [flags]
8384
```
8485

85-
### Running `x.py` slightly more conveniently
86+
On Windows, the Powershell commands may give you an error that looks like this:
87+
```
88+
PS C:\Users\vboxuser\rust> ./x
89+
./x : File C:\Users\vboxuser\rust\x.ps1 cannot be loaded because running scripts is disabled on this system. For more
90+
information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
91+
At line:1 char:1
92+
+ ./x
93+
+ ~~~
94+
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
95+
+ FullyQualifiedErrorId : UnauthorizedAccess
96+
```
97+
98+
You can avoid this error by allowing powershell to run local scripts:
99+
```
100+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
101+
```
102+
103+
#### Running `x.py` slightly more conveniently
86104

87105
There is a binary that wraps `x.py` called `x` in `src/tools/x`. All it does is
88106
run `x.py`, but it can be installed system-wide and run from any subdirectory

0 commit comments

Comments
 (0)