title: Visual effects set to "Adjust for best Performance" using Powershell DSC
body: <p>I am trying to set the Visual effects to "adjust to best performance" to optimize the OS performance.I am using Powershell DSC configuration which referring registry resource and applying this configuration.</p>
  
  <p>Before creating the configuration file, i am running powershell commands for testing purpose.I am running the following commands</p>
  
  <pre><code>PS C:\WINDOWS\system32&gt; $path = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects'
  
  PS C:\WINDOWS\system32&gt; $s = (Get-ItemProperty -ErrorAction stop -Name visualfxsetting -Path $path).visualfxsetting.
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>PS C:\WINDOWS\system32&gt; $s = (Get-ItemProperty -ErrorAction stop -Name visualfxsetting -Path $path).visualfxsetting 
  Get-ItemProperty : Property visualfxsetting does not exist at path HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects.
  At line:1 char:7
  + $s = (Get-ItemProperty -ErrorAction stop -Name visualfxsetting -Path  ...
  +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (visualfxsetting:String) [Get-ItemProperty], PSArgumentException
      + FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.GetItemPropertyCommand.
  </code></pre>
  
  <p>When i look in the registry editor, there is no key named visualfxsetting under VisualEffects and no value set.</p>
  
  <p><a href="https://i.stack.imgur.com/ujZUN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ujZUN.png" alt="enter image description here"></a></p>
  
  <p>Does this mean first i have to create a registry key and value and then use it to apply the configuration? If so what type of registry key i have to create and what value i have to set?</p>