giorgio123
Goto Top

Powershell Registry Error

Guten Tag

Ich habe versucht einen Registry Eintrag mit Powershell zu erstellen, jedoch hat es leider nicht geklappt und ic kann mir das nicht erklären.
Vielen Dank im Voraus.

Hier ist mein PS Script:
$HKCUKeyPath1 = "HKEY_CURRENT_USER\SOFTWARE\Autodesk\Navisworks Freedom x64\16.0\GlobalOptions\interface\first_run"  
$HKCUKeyPath2 = "HKEY_CURRENT_USER\SOFTWARE\Autodesk\MC3"  


if (!(Test-Path $HKCUKeyPath1)) {
New-Item $HKCUKeyPath1 -ErrorAction Stop -Force
New-ItemProperty -Path $HKCUKeyPath1 -Name "@" -Value 0 -PropertyType "DWORD"  
New-ItemProperty -Path $HKCUKeyPath1 -Name show_help -Value "3 0" -PropertyType "STRING"  
}

if (!(Test-Path $HKCUKeyPath2)) {
New-Item $HKCUKeyPath2 -ErrorAction Stop -Force
New-ItemProperty -Path $HKCUKeyPath2 -Name OverridedByHKLM -Value 0 -PropertyType "DWORD"  
New-ItemProperty -Path $HKCUKeyPath2 -Name ADARePrompted -Value 1 -PropertyType "DWORD"  
}


Und hier die Ausgabe:
PS C:\Users\gimai> $HKCUKeyPath1 = "HKEY_CURRENT_USER\SOFTWARE\Autodesk\Navisworks Freedom x64\16.0\GlobalOptions\interface\first_run"
$HKCUKeyPath2 = "HKEY_CURRENT_USER\SOFTWARE\Autodesk\MC3"



if (!(Test-Path $HKCUKeyPath1)) {
New-Item $HKCUKeyPath1 -ErrorAction Stop -Force
New-ItemProperty -Path $HKCUKeyPath1 -Name "@" -Value 0 -PropertyType "DWORD"
New-ItemProperty -Path $HKCUKeyPath1 -Name show_help -Value "3 0" -PropertyType "STRING"
}

if (!(Test-Path $HKCUKeyPath2)) {
New-Item $HKCUKeyPath2 -ErrorAction Stop -Force
New-ItemProperty -Path $HKCUKeyPath2 -Name OverridedByHKLM -Value 0 -PropertyType "DWORD"
New-ItemProperty -Path $HKCUKeyPath2 -Name ADARePrompted -Value 1 -PropertyType "DWORD"
}


    Verzeichnis: C:\Users\gimai\HKEY_CURRENT_USER\SOFTWARE\Autodesk\Navisworks Freedom x64\16.0\GlobalOptions\interface


Mode                LastWriteTime         Length Name                                                                                                                    
----                -------------         ------ ----                                                                                                                    
-a----       06.07.2021     15:46              0 first_run                                                                                                               
New-ItemProperty : Die Schnittstelle kann nicht verwendet werden. Die IDynamicPropertyCmdletProvider-Schnittstelle wird von diesem Anbieter nicht implementiert.
In Zeile:8 Zeichen:1
+ New-ItemProperty -Path $HKCUKeyPath1 -Name "@" -Value 0 -PropertyType ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [New-ItemProperty], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.NewItemPropertyCommand
 
New-ItemProperty : Die Schnittstelle kann nicht verwendet werden. Die IDynamicPropertyCmdletProvider-Schnittstelle wird von diesem Anbieter nicht implementiert.
In Zeile:9 Zeichen:1
+ New-ItemProperty -Path $HKCUKeyPath1 -Name show_help -Value "3 0" -Pr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [New-ItemProperty], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.NewItemPropertyCommand
 


    Verzeichnis: C:\Users\gimai\HKEY_CURRENT_USER\SOFTWARE\Autodesk


Mode                LastWriteTime         Length Name                                                                                                                    
----                -------------         ------ ----                                                                                                                    
-a----       06.07.2021     15:46              0 MC3                                                                                                                     
New-ItemProperty : Die Schnittstelle kann nicht verwendet werden. Die IDynamicPropertyCmdletProvider-Schnittstelle wird von diesem Anbieter nicht implementiert.
In Zeile:14 Zeichen:1
+ New-ItemProperty -Path $HKCUKeyPath2 -Name OverridedByHKLM -Value 0 - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [New-ItemProperty], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.NewItemPropertyCommand
 
New-ItemProperty : Die Schnittstelle kann nicht verwendet werden. Die IDynamicPropertyCmdletProvider-Schnittstelle wird von diesem Anbieter nicht implementiert.
In Zeile:15 Zeichen:1
+ New-ItemProperty -Path $HKCUKeyPath2 -Name ADARePrompted -Value 1 -Pr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [New-ItemProperty], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.NewItemPropertyCommand

Content-Key: 930639169

Url: https://administrator.de/contentid/930639169

Printed on: April 25, 2024 at 20:04 o'clock

Mitglied: 148934
Solution 148934 Jul 07, 2021 updated at 07:54:26 (UTC)
Goto Top
Die Reg Pfade sind für die PS falsch formatiert angegeben
$HKCUKeyPath1 = "HKCU:\SOFTWARE\Autodesk\Navisworks Freedom x64\16.0\GlobalOptions\interface\first_run"  
$HKCUKeyPath2 = "HKCU:\SOFTWARE\Autodesk\MC3"  
Member: giorgio123
giorgio123 Jul 07, 2021 at 08:19:14 (UTC)
Goto Top
Hat funktioniert Danke face-smile