windows - 为什么我的 Powershell 中的 Set-DisplayResolution 命令不见了?

标签 windows powershell

我在我的 Mac 上使用 Parallels 来运行 Windows 8.1 操作系统。 Parallels 有一个怪癖,每次重新启动时都会将屏幕分辨率重置为最高级别。因此,我想编写一个简短的 Powershell 脚本,自动将我的屏幕分辨率设置为我喜欢的分辨率。问题是,使用 Set-ScreenResolutionSet-DisplayResolution 会出现以下错误:

Set-DisplayResolution : The term 'Set-DisplayResolution' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + Set-DisplayResolution + ~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Set-DisplayResolution:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

知道为什么会这样吗?

我使用的是 Windows 8.1 64 位。我的Powershell版本是4.0。我在 Yosemite 操作系统 (mac) 上使用 Parallels 9 作为我的虚拟机。

最佳答案

Get-DisplayResolutionSet-DisplayResolution 仅在 Server Core 上可用。

网络搜索指向这个article显示如何从 PowerShell 调用适当的 user32 函数。它有望为您指明正确的方向。

关于windows - 为什么我的 Powershell 中的 Set-DisplayResolution 命令不见了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28817636/

相关文章:

Powershell: 'The fully qualified file name must be less than 260 characters'

powershell - 在 powershell 中创建多个(子)注册表项

com - 有什么方法可以终止 Powershell 中的挂起进程吗?

powershell - 如何在Sitecore 7.2中安装TDS生成的.update软件包?

windows - 似乎无法让 Node.js 命令行解释我写的内容,一直返回 "..."?

windows - 德尔福 : Sleep without freeze and processmessages

c++ - 获取 ram 制造商

Windows命令行将字符串传递给groovy

powershell - 如何在 Powershell 中执行相当于 $PROGPATH/program 的 bash 操作?

c# - Visual Studio 2017 RC - C# UWP 项目 - 无法创建类