Windows Nano Server安装配置详解09:Nano Powershell

时间:2022-06-27 05:54:01

从 5.1 版本开始,PowerShell 在具有不同功能集和平台兼容性的不同版本中可用。

桌面版:基于 .NET Framework 而构建,兼容面向在 Windows 完整占用空间版本(例如,Server Core 和 Windows Desktop)上运行的 PowerShell 版本的脚本和模块。

核心版:基于 .NET Core 而构建,,兼容面向在 Windows 占用空间减小版本(例如,Nano Server 和 Windows IoT)上运行的 PowerShell 版本的脚本和模块。

当前运行的 PowerShell 版本显示在 $PSVersionTable 的 PSEdition 属性中。

Windows Nano Server安装配置详解09:Nano Powershell

Nano Server 上 PowerShell 的差异

默认情况下,Nano Server 在所有 Nano Server 安装中都包括 PowerShell Core。 PowerShell Core 是基于 .NET Core 构建的 PowerShell 占用空间减小版本,且在占用空间减小版本的 Windows(例如,Nano Server 和 Windows IoT Core)上运行。 PowerShell Core 与其他 PowerShell 版本(例如 Windows Server 2016 上运行的 Windows PowerShell)运行方式相同。 然而,Nano Server 占用空间减少意味着不是所有 Windows Server 2016 中的 PowerShell 功能都在 Nano Server 上的 PowerShell Core 中可用。

结合使用 Windows PowerShell Desired State Configuration 与 Nano Server

可以使用 Windows PowerShell Desired State Configuration (DSC) 将 Nano Server 作为目标节点来管理。 目前,仅可以在请求模式下管理使用 DSC 运行 Nano Server 的节点。 并非所有 DSC 功能都与 Nano Server 正常运行。