我正在使用以下 Powershell DSC 配置来禁用视觉效果。
Configuration OSConfig
{
param
(
[parameter()]
[string]
$NodeName = 'localhost'
)
# It is best practice to always directly import resources, even if the resource is a built-in resource.
Import-DscResource -Name Service
Import-DSCResource -Name WindowsClient
Import-DscResource -Name Registry
Import-DscResource -Name WindowsFeature
Import-DscResource -Name WindowsOptionalFeature
Node $NodeName
{
# The name of this resource block, can be anything you choose, as long as it is of type [String] as indicated by the schema.
Registry VisualEffects
{
Ensure = "Present"
Key = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects"
ValueName = "VisualFXSetting"
ValueData = "2"
ValueType = "Dword"
}
}
}
在我运行 Start-DSCConfiguration 命令后,我可以看到 visualfxsetting 值已更新为 2。但在 GUI(在高级系统属性 -> 视觉效果下)它仍然显示为“让计算机选择最适合你的”而不是“调整以获得最佳性能”。对此有任何想法吗?