From da846996f56abae5f24073ada9703b711681e43a Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Sat, 24 Sep 2016 12:18:25 +0200 Subject: [PATCH] Add .gitattributes --- .gitattributes | 4 + scripts/remove-default-apps.ps1 | 180 +++++++++++++++---------------- utils/install-basic-software.ps1 | 106 +++++++++--------- 3 files changed, 147 insertions(+), 143 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..21107f3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text=auto +*.ps1 text eol=crlf +*.psm1 text eol=crlf +*.reg text eol=crlf diff --git a/scripts/remove-default-apps.ps1 b/scripts/remove-default-apps.ps1 index 5e5b781..2163109 100644 --- a/scripts/remove-default-apps.ps1 +++ b/scripts/remove-default-apps.ps1 @@ -1,90 +1,90 @@ -# Description: -# 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\take-own.psm1 - -echo "Elevating priviledges for this process" -do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) - -echo "Uninstalling default apps" -$apps = @( - # default Windows 10 apps - "Microsoft.3DBuilder" - "Microsoft.Appconnector" - "Microsoft.BingFinance" - "Microsoft.BingNews" - "Microsoft.BingSports" - "Microsoft.BingWeather" - #"Microsoft.FreshPaint" - "Microsoft.Getstarted" - "Microsoft.MicrosoftOfficeHub" - "Microsoft.MicrosoftSolitaireCollection" - #"Microsoft.MicrosoftStickyNotes" - "Microsoft.Office.OneNote" - #"Microsoft.OneConnect" - "Microsoft.People" - "Microsoft.SkypeApp" - #"Microsoft.Windows.Photos" - "Microsoft.WindowsAlarms" - #"Microsoft.WindowsCalculator" - "Microsoft.WindowsCamera" - "Microsoft.WindowsMaps" - "Microsoft.WindowsPhone" - "Microsoft.WindowsSoundRecorder" - #"Microsoft.WindowsStore" - "Microsoft.XboxApp" - "Microsoft.ZuneMusic" - "Microsoft.ZuneVideo" - "microsoft.windowscommunicationsapps" - "Microsoft.MinecraftUWP" - - # Threshold 2 apps - "Microsoft.CommsPhone" - "Microsoft.ConnectivityStore" - "Microsoft.Messaging" - "Microsoft.Office.Sway" - - - #Redstone apps - "Microsoft.BingFoodAndDrink" - "Microsoft.BingTravel" - "Microsoft.BingHealthAndFitness" - "Microsoft.WindowsReadingList" - - # non-Microsoft - "9E2F88E3.Twitter" - "Flipboard.Flipboard" - "ShazamEntertainmentLtd.Shazam" - "king.com.CandyCrushSaga" - "king.com.CandyCrushSodaSaga" - "king.com.*" - "ClearChannelRadioDigital.iHeartRadio" - "4DF9E0F8.Netflix" - "6Wunderkinder.Wunderlist" - "Drawboard.DrawboardPDF" - "2FE3CB00.PicsArt-PhotoStudio" - "D52A8D61.FarmVille2CountryEscape" - "TuneIn.TuneInRadio" - "GAMELOFTSA.Asphalt8Airborne" - #"TheNewYorkTimes.NYTCrossword" - - # apps which cannot be removed using Remove-AppxPackage - #"Microsoft.BioEnrollment" - #"Microsoft.MicrosoftEdge" - #"Microsoft.Windows.Cortana" - #"Microsoft.WindowsFeedback" - #"Microsoft.XboxGameCallableUI" - #"Microsoft.XboxIdentityProvider" - #"Windows.ContactSupport" -) - -foreach ($app in $apps) { - echo "Trying to remove $app" - - Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage - - Get-AppXProvisionedPackage -Online | - where DisplayName -EQ $app | - Remove-AppxProvisionedPackage -Online -} +# Description: +# 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\take-own.psm1 + +echo "Elevating priviledges for this process" +do {} until (Elevate-Privileges SeTakeOwnershipPrivilege) + +echo "Uninstalling default apps" +$apps = @( + # default Windows 10 apps + "Microsoft.3DBuilder" + "Microsoft.Appconnector" + "Microsoft.BingFinance" + "Microsoft.BingNews" + "Microsoft.BingSports" + "Microsoft.BingWeather" + #"Microsoft.FreshPaint" + "Microsoft.Getstarted" + "Microsoft.MicrosoftOfficeHub" + "Microsoft.MicrosoftSolitaireCollection" + #"Microsoft.MicrosoftStickyNotes" + "Microsoft.Office.OneNote" + #"Microsoft.OneConnect" + "Microsoft.People" + "Microsoft.SkypeApp" + #"Microsoft.Windows.Photos" + "Microsoft.WindowsAlarms" + #"Microsoft.WindowsCalculator" + "Microsoft.WindowsCamera" + "Microsoft.WindowsMaps" + "Microsoft.WindowsPhone" + "Microsoft.WindowsSoundRecorder" + #"Microsoft.WindowsStore" + "Microsoft.XboxApp" + "Microsoft.ZuneMusic" + "Microsoft.ZuneVideo" + "microsoft.windowscommunicationsapps" + "Microsoft.MinecraftUWP" + + # Threshold 2 apps + "Microsoft.CommsPhone" + "Microsoft.ConnectivityStore" + "Microsoft.Messaging" + "Microsoft.Office.Sway" + + + #Redstone apps + "Microsoft.BingFoodAndDrink" + "Microsoft.BingTravel" + "Microsoft.BingHealthAndFitness" + "Microsoft.WindowsReadingList" + + # non-Microsoft + "9E2F88E3.Twitter" + "Flipboard.Flipboard" + "ShazamEntertainmentLtd.Shazam" + "king.com.CandyCrushSaga" + "king.com.CandyCrushSodaSaga" + "king.com.*" + "ClearChannelRadioDigital.iHeartRadio" + "4DF9E0F8.Netflix" + "6Wunderkinder.Wunderlist" + "Drawboard.DrawboardPDF" + "2FE3CB00.PicsArt-PhotoStudio" + "D52A8D61.FarmVille2CountryEscape" + "TuneIn.TuneInRadio" + "GAMELOFTSA.Asphalt8Airborne" + #"TheNewYorkTimes.NYTCrossword" + + # apps which cannot be removed using Remove-AppxPackage + #"Microsoft.BioEnrollment" + #"Microsoft.MicrosoftEdge" + #"Microsoft.Windows.Cortana" + #"Microsoft.WindowsFeedback" + #"Microsoft.XboxGameCallableUI" + #"Microsoft.XboxIdentityProvider" + #"Windows.ContactSupport" +) + +foreach ($app in $apps) { + echo "Trying to remove $app" + + Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage + + Get-AppXProvisionedPackage -Online | + where DisplayName -EQ $app | + Remove-AppxProvisionedPackage -Online +} diff --git a/utils/install-basic-software.ps1 b/utils/install-basic-software.ps1 index a7341bd..9566505 100644 --- a/utils/install-basic-software.ps1 +++ b/utils/install-basic-software.ps1 @@ -1,53 +1,53 @@ -# Description: -# This script will use Windows package manager to bootstrap Chocolatey and -# install a list of packages. Script will also install Sysinternals Utilities -# into your default drive's root directory. - -$packages = @( - "notepadplusplus.install" - "peazip.install" - #"7zip.install" - #"aimp" - #"audacity" - #"autoit" - #"classic-shell" - #"filezilla" - #"firefox" - #"gimp" - #"google-chrome-x64" - #"imgburn" - #"keepass.install" - #"paint.net" - #"putty" - #"python" - #"qbittorrent" - #"speedcrunch" - #"sysinternals" - #"thunderbird" - #"vlc" - #"windirstat" - #"wireshark" -) - -echo "Setting up Chocolatey software package manager" -Get-PackageProvider -Name chocolatey -Force - -echo "Creating daily task to automatically upgrade Chocolatey packages" -# adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/ -$taskName = "Chocolatey Daily Upgrade" -$taskAction = New-ScheduledTaskAction –Execute C:\programdata\chocolatey\choco.exe -Argument "upgrade all -y" -$taskTrigger = New-ScheduledTaskTrigger -At 2am -Daily -$taskUser = "Admin" -Register-ScheduledTask –TaskName $taskName -Action $taskAction –Trigger $taskTrigger -User $taskUser - -echo "Installing Packages" -Install-Package -Name $packages -Force -ProviderName chocolatey - -echo "Installing Sysinternals Utilities to C:\Sysinternals" -$download_uri = "https://download.sysinternals.com/files/SysinternalsSuite.zip" -$wc = new-object net.webclient -$wc.DownloadFile($download_uri, "/SysinternalsSuite.zip") -Add-Type -AssemblyName "system.io.compression.filesystem" -[io.compression.zipfile]::ExtractToDirectory("/SysinternalsSuite.zip", "/Sysinternals") -echo "Removing zipfile" -rm "/SysinternalsSuite.zip" +# Description: +# This script will use Windows package manager to bootstrap Chocolatey and +# install a list of packages. Script will also install Sysinternals Utilities +# into your default drive's root directory. + +$packages = @( + "notepadplusplus.install" + "peazip.install" + #"7zip.install" + #"aimp" + #"audacity" + #"autoit" + #"classic-shell" + #"filezilla" + #"firefox" + #"gimp" + #"google-chrome-x64" + #"imgburn" + #"keepass.install" + #"paint.net" + #"putty" + #"python" + #"qbittorrent" + #"speedcrunch" + #"sysinternals" + #"thunderbird" + #"vlc" + #"windirstat" + #"wireshark" +) + +echo "Setting up Chocolatey software package manager" +Get-PackageProvider -Name chocolatey -Force + +echo "Creating daily task to automatically upgrade Chocolatey packages" +# adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/ +$taskName = "Chocolatey Daily Upgrade" +$taskAction = New-ScheduledTaskAction –Execute C:\programdata\chocolatey\choco.exe -Argument "upgrade all -y" +$taskTrigger = New-ScheduledTaskTrigger -At 2am -Daily +$taskUser = "Admin" +Register-ScheduledTask –TaskName $taskName -Action $taskAction –Trigger $taskTrigger -User $taskUser + +echo "Installing Packages" +Install-Package -Name $packages -Force -ProviderName chocolatey + +echo "Installing Sysinternals Utilities to C:\Sysinternals" +$download_uri = "https://download.sysinternals.com/files/SysinternalsSuite.zip" +$wc = new-object net.webclient +$wc.DownloadFile($download_uri, "/SysinternalsSuite.zip") +Add-Type -AssemblyName "system.io.compression.filesystem" +[io.compression.zipfile]::ExtractToDirectory("/SysinternalsSuite.zip", "/Sysinternals") +echo "Removing zipfile" +rm "/SysinternalsSuite.zip"