Skip to content

Commit

Permalink
add powershell 7
Browse files Browse the repository at this point in the history
  • Loading branch information
chenlei0608 committed Oct 26, 2024
1 parent e32caea commit ec068b5
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default defineConfig({
collapsed: false,
items: [
{ text: 'corepack', link: 'corepack' },
{ text: '第三季度技术分享', link: 'share-quarter-3' }
{ text: '第三季度技术分享', link: 'share-quarter-3' },
{ text: 'Powershell 7', link: 'powershell7' }
]
}
]
Expand Down
42 changes: 42 additions & 0 deletions src/frontend/powershell7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Powershell 7

PowerShell 是一种跨平台的任务自动化解决方案,由命令行 shell、脚本语言和配置管理框架组成。

在 Windows 10,Windows 11,内置的版本是 Powershell 5,如果想要 Powershell 的最新功能,比如自动补全功能,可以尝试 Powershell 7

## 安装 Powershell 7

- 在 Windows 上使用 winget 安装:

```sh
winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell --source winget
```

- 更多版本的 Powershell 请移步到 [Github Powershell Releases](https://github.com/PowerShell/PowerShell/releases) 下载
- 更多安装方式请查看:[安装 Powershell 7](https://learn.microsoft.com/zh-cn/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4)

## 更改 Windows Terminal 的默认终端

在 Windows 10,Windows 11,没有内置 Windows Terminal,如果想要使用,请移步到 [GitHub Terminal Releases](https://github.com/microsoft/terminal/releases) 安装

![操作1](/windows-terminal-default-to-powershell7-1.png)

![操作2](/windows-terminal-default-to-powershell7-2.png)

## 更改 VS Code 的默认终端

1. 使用管理员权限打开 VS Code
2. 在 settings.json 写入下面内容

```json
"terminal.integrated.defaultProfile.windows": "PowerShell"
```

## 最后

此时就可以快乐地使用自动补全功能了,使用 tab 键可以切换补全内容

![示例](/auto-complete.png)


Binary file added src/public/auto-complete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ec068b5

Please sign in to comment.