I am pretty new into making PowerShell Scripts. I got a task from my company to set all registry keys from a .ps1 file. I have found a function that only sets 1 registry entry, but not all of them inside the .ps1 file.
The function that I have found is this one: https://www.powershellgallery.com/packages/Carbon/2.3.0/Content/Functions%5CSet-RegistryKeyValue.ps1
Problem with this function is, that it only sets one key at a time when I am calling it. Is there another way to solve this issue, or do I have to take this solution even if I have to call this function 33 times.
These are my registry entries that needed to be set/installed:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy]
"LastUpdateCheck"=hex(b):2f,dd,6f,5c,00,00,00,00
"SettingsFormPosX"=dword:000003c3
"SettingsFormPosY"=dword:000001ac
"MainMenuDisplayOrder"="{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}"
"SubmenuDisplayOrder"="{3a42b5c6-72d6-4a8a-ba44-014fa64aa11a},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{331a3b60-af49-44f4-b30d-56adff6d25e8},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{8f2adccc-9693-407d-9300-fccb9a12b982},{7da6a4a2-ae54-40e0-9910-ebd9ef3f017e}"
"UIDisplayOrder"="{c8757dca-1ba8-48d0-8145-b93bbb9237af},{3a42b5c6-72d6-4a8a-ba44-014fa64aa11a},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{93b362d1-2b13-467a-b618-6784f24f3ba1},{331a3b60-af49-44f4-b30d-56adff6d25e8},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{0929538b-5f52-4480-9902-2bbec9c84905},{349939d7-780f-43fd-a98e-83d9add44e22},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{891f9e3e-0b70-49fd-a86c-53b21c6193c7},{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{73188fb3-8e14-409c-95ef-ba608fdc1274},{e2c942ac-917c-4aee-a867-8f6ab960ba76},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{8f2adccc-9693-407d-9300-fccb9a12b982},{7da6a4a2-ae54-40e0-9910-ebd9ef3f017e},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{5b5da5cb-3284-45a9-a1e5-4d6b03107924},{cd50dce3-9a5c-4adf-b552-1741361567d6},{bd574871-5df9-4b64-83d1-2af9c0c17f66}"
"KnownPlugins"="{0929538b-5f52-4480-9902-2bbec9c84905},{331a3b60-af49-44f4-b30d-56adff6d25e8},{349939d7-780f-43fd-a98e-83d9add44e22},{3a42b5c6-72d6-4a8a-ba44-014fa64aa11a},{5b5da5cb-3284-45a9-a1e5-4d6b03107924},{73188fb3-8e14-409c-95ef-ba608fdc1274},{7da6a4a2-ae54-40e0-9910-ebd9ef3f017e},{891f9e3e-0b70-49fd-a86c-53b21c6193c7},{8f2adccc-9693-407d-9300-fccb9a12b982},{93b362d1-2b13-467a-b618-6784f24f3ba1},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{bd574871-5df9-4b64-83d1-2af9c0c17f66},{c8757dca-1ba8-48d0-8145-b93bbb9237af},{cd50dce3-9a5c-4adf-b552-1741361567d6},{e2c942ac-917c-4aee-a867-8f6ab960ba76},{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}"
"AddQuotes"=dword:00000001
"AreQuotesOptional"=dword:00000001
"UseFQDN"=dword:00000001
"DisableSoftwareUpdate"=dword:00000001
"SettingsFormSizeWidth"=dword:00000201
"SettingsFormSizeHeight"=dword:0000027e
"AlwaysShowSubmenu"=dword:00000001
"UseIconForSubmenu"=dword:00000001
"DropRedundantWords"=dword:00000001
"UsePreviewMode"=dword:00000000
[HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy\Icons]
[HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy\PipelinePlugins]
"DisplayOrder"=""
[HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy\Plugins]
[HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy\Rundll32Output]
[HKEY_CURRENT_USER\Software\clechasseur\PathCopyCopy\TempPipelinePlugins]
[HKEY_LOCAL_MACHINE\Software\clechasseur\PathCopyCopy]
"LastUpdateCheck"=hex(b):2f,dd,6f,5c,00,00,00,00
"SettingsFormPosX"=dword:000003c3
"SettingsFormPosY"=dword:000001ac
"MainMenuDisplayOrder"="{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}"
"SubmenuDisplayOrder"="{3a42b5c6-72d6-4a8a-ba44-014fa64aa11a},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{331a3b60-af49-44f4-b30d-56adff6d25e8},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{8f2adccc-9693-407d-9300-fccb9a12b982},{7da6a4a2-ae54-40e0-9910-ebd9ef3f017e}"
"UIDisplayOrder"="{c8757dca-1ba8-48d0-8145-b93bbb9237af},{3a42b5c6-72d6-4a8a-ba44-014fa64aa11a},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{93b362d1-2b13-467a-b618-6784f24f3ba1},{331a3b60-af49-44f4-b30d-56adff6d25e8},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{0929538b-5f52-4480-9902-2bbec9c84905},{349939d7-780f-43fd-a98e-83d9add44e22},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{891f9e3e-0b70-49fd-a86c-53b21c6193c7},{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{73188fb3-8e14-409c-95ef-ba608fdc1274},{e2c942ac-917c-4aee-a867-8f6ab960ba76},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{8f2adccc-9693-407d-9300-fccb9a12b982},{7da6a4a2-ae54-40e0-9910-ebd9ef3f017e},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{5b5da5cb-3284-45a9-a1e5-4d6b03107924},{cd50dce3-9a5c-4adf-b552-1741361567d6},{bd574871-5df9-4b64-83d1-2af9c0c17f66}"
"KnownPlugins"="{0929538b-5f52-4480-9902-2bbec9c84905},{331a3b60-af49-44f4-b30d-56adff6d25e8},{349939d7-780f-43fd-a98e-83d9add44e22},{3a42b5c6-72d6-4a8a-ba44-014fa64aa11a},{5b5da5cb-3284-45a9-a1e5-4d6b03107924},{73188fb3-8e14-409c-95ef-ba608fdc1274},{7da6a4a2-ae54-40e0-9910-ebd9ef3f017e},{891f9e3e-0b70-49fd-a86c-53b21c6193c7},{8f2adccc-9693-407d-9300-fccb9a12b982},{93b362d1-2b13-467a-b618-6784f24f3ba1},{afa4d1e1-ba73-4330-a6ab-e574ff39ecc3},{bd574871-5df9-4b64-83d1-2af9c0c17f66},{c8757dca-1ba8-48d0-8145-b93bbb9237af},{cd50dce3-9a5c-4adf-b552-1741361567d6},{e2c942ac-917c-4aee-a867-8f6ab960ba76},{ea24bcc3-35f5-46b9-a2a5-a12a0aed2d28}"
"AddQuotes"=dword:00000001
"AreQuotesOptional"=dword:00000001
"UseFQDN"=dword:00000001
"DisableSoftwareUpdate"=dword:00000001
"SettingsFormSizeWidth"=dword:00000201
"SettingsFormSizeHeight"=dword:0000027e
"AlwaysShowSubmenu"=dword:00000001
"UseIconForSubmenu"=dword:00000001
"DropRedundantWords"=dword:00000001
"UsePreviewMode"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\clechasseur\PathCopyCopy\Icons]
[HKEY_LOCAL_MACHINE\Software\clechasseur\PathCopyCopy\PipelinePlugins]
"DisplayOrder"=""
[HKEY_LOCAL_MACHINE\Software\clechasseur\PathCopyCopy\Plugins]
[HKEY_LOCAL_MACHINE\Software\clechasseur\PathCopyCopy\Rundll32Output]
[HKEY_LOCAL_MACHINE\Software\clechasseur\PathCopyCopy\TempPipelinePlugins]
I hope that somebody is skilled in making PowerShell Scripts. I would really appreciate it if someone could help me with my issue!
Kind regards, II
If your environment allows the usage of registry editing tools, you can do
Or, if that is not allowed, you can create a script that sets all of these values by translating the registry file entries into PowerShell code:
P.S. The settings that need to be set also include settings under
HKEY_LOCAL_MACHINE. Do your users have permission to access these keys? If not, you should comment these out or remove them alltogether