本文概述
- PowerShell和PowerShell Core之间的差异
- 在Windows上安装PowerShell Core
- 启动PowerShell Core
PowerShell Core是开源的, 可在Windows, Linux和Mac操作系统上使用。它建立在.NET核心上。
PowerShell核心在Linux和MacOS上以pwsh的形式启动, 在Windows上以pwsh.exe的形式启动。
【PowerShell Core介绍和安装详细步骤】PowerShell Core 6.0版于2016年8月18日首次引入。
PowerShell和PowerShell Core之间的差异 下表描述了PowerShell和PowerShell核心之间的区别:
Attributes | PowerShell | PowerShell核心 |
---|---|---|
Versions | 1.0至5.1 | 6.0 |
Platform Supported | Windows | Linux, MacOS和Windows |
Dependency | .NET Framework | .NET核心 |
推出为 | powershell.exe | 对于MacOS和Linux, 为pwsh;对于Windows, 为pwsh.exe |
Uses | 它依赖于.NET Framework运行时。 | 它取决于.NET Core运行时。 |
$PSVersionTable.PSEdition | 设置为桌面 | 它设置为Core。 |
1)首先从PowerShell的GitHub页面下载MSI文件。单击以下链接进行下载:
https://github.com/PowerShell/PowerShell
2)现在, 转到Get PowerShell, 然后根据系统版本从download(stable)列中单击.msi链接, 如以下屏幕快照所示:

文章图片
3)现在, 单击下载的文件进行安装。单击后, 将出现以下安装向导。并且, 继续安装, 单击下一步

文章图片
4)以下窗口显示了PowerShell的默认安装路径。如果要更改它, 则根据你的选择进行更改, 否则, 请单击” 下一步” 。

文章图片
5)同样, 根据需要选择选项后, 单击” 下一步” 按钮。

文章图片
6)最后, 单击” 安装”

文章图片
7)安装后, PowerShell核心已成功安装在你的计算机系统中。

文章图片
启动PowerShell Core 要启动PowerShell核心, 请执行以下步骤:
1)单击开始, 搜索PowerShell 6, 然后单击它。

文章图片
2)单击后, 将打开PowerShell 6窗口。

文章图片
推荐阅读
- PowerShell do-while循环语句
- PowerShell Copy-Item| PowerShell复制文件
- continue和break语句示例
- PowerShell Clear-Content清除内容
- PowerShell比较运算符
- PowerShell注释
- PowerShell赋值运算符
- PowerShell Add-Content| PowerShell附加到文件
- PowerShell自动变量