Skip to content

Commit

Permalink
update to windows powershell.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelliao committed Mar 6, 2025
1 parent 25e8d8f commit 9f1ac13
Show file tree
Hide file tree
Showing 9 changed files with 185 additions and 191 deletions.
28 changes: 13 additions & 15 deletions source/books/java/150-maven/10-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,19 @@ Windows可以把`%M2_HOME%\bin`添加到系统Path变量中。
然后,打开命令行窗口,输入`mvn -version`,应该看到Maven的版本信息:

```ascii
┌────────────────────────────────────────────────────────┐
│Command Prompt - □ x │
├────────────────────────────────────────────────────────┤
│Microsoft Windows [Version 10.0.0] │
│(c) 2015 Microsoft Corporation. All rights reserved. │
│ │
│C:\> mvn -version │
│Apache Maven 3.9.x ... │
│Maven home: C:\Users\liaoxuefeng\maven │
│Java version: ... │
│... │
│ │
│C:\> _ │
│ │
└────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│Windows PowerShell - □ x │
├─────────────────────────────────────────────────────────┤
│Windows PowerShell │
│Copyright (C) Microsoft Corporation. All rights reserved.│
│ │
│PS C:\Users\liaoxuefeng> mvn -version │
│Apache Maven 3.9.x ... │
│Maven home: C:\Users\liaoxuefeng\maven │
│Java version: ... │
│... │
│ │
└─────────────────────────────────────────────────────────┘
```

如果提示命令未找到,说明系统PATH路径有误,需要修复后再运行。
Expand Down
48 changes: 24 additions & 24 deletions source/books/javascript/110-nodejs/20-first-node-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,39 @@ Error: Cannot find module 'C:\Workspace\hello.js'

请注意区分命令行模式和Node交互模式。

看到类似`C:\>`是在Windows提供的命令行模式:
看到类似`PS C:\>`是在Windows提供的命令行模式:

```ascii
┌────────────────────────────────────────────────────────┐
Command Prompt - □ x │
├────────────────────────────────────────────────────────┤
Microsoft Windows [Version 10.0.0]
(c) 2015 Microsoft Corporation. All rights reserved.
│ │
│C:\> node hello.js
│Hello, world. │
│ │
│C:\>
│ │
└────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────
Windows PowerShell - □ x │
├────────────────────────────────────────────────────────
│Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.│
PS C:\Users\liaoxuefeng> node hello.js │
│Hello, world.
PS C:\Users\liaoxuefeng>
└────────────────────────────────────────────────────────
```

在命令行模式下,可以执行`node`进入Node交互式环境,也可以执行`node hello.js`运行一个`.js`文件。

看到`>`是在Node交互式环境下:

```ascii
┌────────────────────────────────────────────────────────┐
Command Prompt - □ x │
├────────────────────────────────────────────────────────┤
Microsoft Windows [Version 10.0.0]
(c) 2015 Microsoft Corporation. All rights reserved.
│ │
│C:\> node
│Welcome to Node.js v22.x.x. │
│> │
│ │
└────────────────────────────────────────────────────────┘
┌────────────────────────────────────────────────────────
Windows PowerShell - □ x │
├────────────────────────────────────────────────────────
│Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.│
PS C:\Users\liaoxuefeng> node │
│Welcome to Node.js v22.x.x.
│>
└────────────────────────────────────────────────────────
```

在Node交互式环境下,我们可以输入JavaScript代码并立刻执行。
Expand Down
10 changes: 5 additions & 5 deletions source/books/python/190-network/20-tcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,22 +162,22 @@ s.close()

```ascii
┌────────────────────────────────────────────────────────┐
Command Prompt - □ x │
Windows PowerShell - □ x │
├────────────────────────────────────────────────────────┤
$ python echo_server.py
PS C:\Users\liaoxuefeng> python echo_server.py │
│Waiting for connection... │
│Accept new connection from 127.0.0.1:64398... │
│Connection from 127.0.0.1:64398 closed. │
│ │
│ ┌────────────────────────────────────────────────┴───────┐
│ │Command Prompt - □ x │
│ │Windows PowerShell - □ x │
│ ├────────────────────────────────────────────────────────┤
└───────┤$ python echo_client.py
└───────┤PS C:\Users\liaoxuefeng> python echo_client.py │
│Welcome! │
│Hello, Michael! │
│Hello, Tracy! │
│Hello, Sarah! │
$
PS C:\Users\liaoxuefeng>
│ │
│ │
└────────────────────────────────────────────────────────┘
Expand Down
10 changes: 5 additions & 5 deletions source/books/python/190-network/30-udp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ s.close()

```ascii
┌────────────────────────────────────────────────────────┐
Command Prompt - □ x │
Windows PowerShell - □ x │
├────────────────────────────────────────────────────────┤
$ python udp_server.py
PS C:\Users\liaoxuefeng> python udp_server.py │
│Bind UDP on 9999... │
│Received from 127.0.0.1:63823... │
│Received from 127.0.0.1:63823... │
│Received from 127.0.0.1:63823... │
│ ┌────────────────────────────────────────────────┴───────┐
│ │Command Prompt - □ x │
│ │Windows PowerShell - □ x │
│ ├────────────────────────────────────────────────────────┤
│ │$ python udp_client.py
│ │PS C:\Users\liaoxuefeng> python udp_client.py │
└───────┤Welcome! │
│Hello, Michael! │
│Hello, Tracy! │
│Hello, Sarah! │
$
PS C:\Users\liaoxuefeng>
│ │
│ │
└────────────────────────────────────────────────────────┘
Expand Down
Loading

0 comments on commit 9f1ac13

Please sign in to comment.