Prepare demo enviroment
start regedit -verb runas # Start GUI registry editor in elevated priviliged / Administrator mode to cross check things
Run Demo Cases
1 Create new Key/Item {1_Test_Key } under Registry Path { HKLM:\SOFTWARE }
New-item -Path HKLM:\SOFTWARE -Name 1_Test_Key
2 Create new Key/Item {2_Test_Key } under Registry Path { HKLM:\SOFTWARE } by defining name of Key in Path Only
New-Item -path HKLM:\SOFTWARE\2_Test_Key
3 Create new Key {Sub_Test_Key} under All newly created Keys. ## Hint - Use * (Wild Card) in -Path parameter to crete in bulk
New-Item -Path HKLM:\SOFTWARE\*test* -Name Sub_Test_Key
4 Create new Key { 3_Test_Key } under Registry Path { HKLM:\SOFTWARE } ,Hint - get confirmation promt before creation of Key
New-Item -Path HKLM:\SOFTWARE -name 3_Test_Key -confirm
5 Try to know expected outcome of a New Registry Key { 4_Test_Key } creation command. Hint - use -whatif parameter
New-Item -Path HKLM:\SOFTWARE -Name 4_Test_Key -WhatIf
Get-childitem -Path HKLM:\SOFTWARE\*test*
6 Use -Force parameter to create in between Keys even if they not exist already
New-Item -Path HKLM:\SOFTWARE\5_Test_Key\3\2\1 -Name 0
New-Item -Path HKLM:\SOFTWARE\5_Test_Key\3\2\1 -Name 0 -force