I'm trying to remove and add a reg key through PS and I end up getting an error. See below. I don't know why it's causing this error.
$path1 = 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
Remove-item -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
$path1 = 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-item -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
New-ItemProperty -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name 'NoAutoUpdate' -Value 0 -PropertyType DWord
Error:
New-ItemProperty : Cannot use interface. The IDynamicPropertyCmdletProvider interface is not implemented by this
provider.
At line:1 char:1
+ New-ItemProperty -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\Wind ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [New-ItemProperty], PSNotSupportedException
+ FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.NewItemPropertyCommand
$path1 = 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
Remove-item -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
$path1 = 'HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
New-item -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU
New-ItemProperty -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name 'NoAutoUpdate' -Value 0 -PropertyType DWord
Error:
New-ItemProperty : Cannot use interface. The IDynamicPropertyCmdletProvider interface is not implemented by this
provider.
At line:1 char:1
+ New-ItemProperty -Path $HKLM\SOFTWARE\Policies\Microsoft\Windows\Wind ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [New-ItemProperty], PSNotSupportedException
+ FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.NewItemPropertyCommand
$HKLM. Why aren't you using the variable you define?New-ItemProperty -Path $path1 ...