在 Windows Server 2008 R2 中安装 PowerShell 5.1

首先需要安装 .NET Framework 4.5.2 或更高版本:https://dotnet.microsoft.com/en-us/download/dotnet-framework

然后下载安装 PowerShell 5.1:https://www.microsoft.com/en-us/download/details.aspx?id=54616

 

如果在执行包含中文内容的脚本时不显示中文,或 Write-Output 中文时出错,如下图:

out-lineoutput : The Win32 internal error "A device attached to the system is not functioning" 0x1F occurred while writing to the console output buffer at the current cursor position. Contact Microsoft Customer Support Services.
+ CategoryInfo : WriteError: (:) [out-lineoutput], HostException
+ FullyQualifiedErrorId : WriteConsole,Microsoft.PowerShell.Commands.OutLineOutputCommand

在 Windows Server 2008 R2 中安装 PowerShell 5.1

 

 请注意修改以下配置:

1、在标题栏中点击右键,选择“属性”:

在 Windows Server 2008 R2 中安装 PowerShell 5.1

 

 2、切换到字体选项卡,将原有默认点阵字体切换为上方字体:

在 Windows Server 2008 R2 中安装 PowerShell 5.1

 

 3、点击确定即可正常使用。

 

参考:https://blog.51cto.com/jameszhan/2642202

上一篇:jsp include 报错:illegal to have multiple occurrences of contentType with different values (old: text/html; charset=UTF-8, new: text/html; carset=UTF-8)


下一篇:sublime text 3 or sublime text 2 安装install package control