From 2d30e50bfd8bef6db7a871fd8794e529503ad5fa Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 22 Aug 2015 20:46:31 +0200 Subject: [PATCH] remove import-registry and rename helper script to take-own --- lib/{reg-helper.psm1 => take-own.psm1} | 11 ----------- scripts/fix-privacy-settings.ps1 | 2 +- scripts/optimize-windows-explorer.ps1 | 2 +- scripts/remove-default-apps.ps1 | 2 +- 4 files changed, 3 insertions(+), 14 deletions(-) rename lib/{reg-helper.psm1 => take-own.psm1} (87%) diff --git a/lib/reg-helper.psm1 b/lib/take-own.psm1 similarity index 87% rename from lib/reg-helper.psm1 rename to lib/take-own.psm1 index e00cfc5..89b2912 100644 --- a/lib/reg-helper.psm1 +++ b/lib/take-own.psm1 @@ -1,14 +1,3 @@ -function Import-Registry($reg) { - # add reg file hander - $reg = "Windows Registry Editor Version 5.00`r`n`r`n" + $reg - - # store, import and remove reg file - $regfile = "$env:windir\Temp\registry.reg" - $reg | Out-File $regfile - Start-Process "regedit.exe" -ArgumentList ("/s", "$regfile") -Wait - rm $regfile -} - function Takeown-Registry($key) { # TODO does not work for all root keys yet switch ($key.split('\')[0]) { diff --git a/scripts/fix-privacy-settings.ps1 b/scripts/fix-privacy-settings.ps1 index b677f9e..4560f61 100644 --- a/scripts/fix-privacy-settings.ps1 +++ b/scripts/fix-privacy-settings.ps1 @@ -2,7 +2,7 @@ # This script will try to fix many of the privacy settings for the user. This # is work in progress! -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\reg-helper.psm1 +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 echo "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) diff --git a/scripts/optimize-windows-explorer.ps1 b/scripts/optimize-windows-explorer.ps1 index d47803d..87d8352 100644 --- a/scripts/optimize-windows-explorer.ps1 +++ b/scripts/optimize-windows-explorer.ps1 @@ -3,7 +3,7 @@ # Exlorer. If you do not want to remove certain user folders comment out the # corresponding lines below. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\reg-helper.psm1 +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 echo "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 1e5899f..92855fd 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -2,7 +2,7 @@ # This script removes unwanted Apps that come with Windows. If you do not want # to remove certain Apps comment out the corresponding lines below. -Import-Module -DisableNameChecking $PSScriptRoot\..\lib\reg-helper.psm1 +Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1 echo "Elevating priviledges for this process" do {} until (Elevate-Privileges SeTakeOwnershipPrivilege)