├── .gitignore ├── Windows 11 configure wallpaper ├── wallpaper.png └── README.md ├── Configure HKLM Run and RunOnce ├── script.ps1 └── README.md ├── Creating viewer requested script 02 ├── wallpaper.png ├── img │ └── request1.png └── README.md ├── Firefox change default search engine ├── img │ └── note.png └── README.md ├── Brave Browser open web pages on startup ├── img │ └── note.png └── README.md ├── Creating viewer requested script 01 ├── img │ └── request.png └── README.md ├── Creating viewer requested script 03 ├── img │ └── request.png └── README.md ├── Google Chrome open web pages on startup ├── img │ └── note.png └── README.md ├── Microsoft Edge open web pages on startup ├── img │ └── note.png └── README.md ├── Set default Brave Browser search provider ├── img │ └── note.png └── README.md ├── Set default Google Chrome search provider ├── img │ └── note.png └── README.md ├── Google Chrome disable first run pop-up windows ├── img │ ├── signin.png │ └── privacysandbox.png └── README.md ├── Windows 11 configure Start layout more pins ├── img │ └── objective.png └── README.md ├── Windows 11 configure Start personalizations ├── img │ └── objective.png └── README.md ├── Windows 11 configure start menu folder icons ├── img │ └── objective.png └── README.md ├── Set Brave Browser Home, New Tab Page and Home Button ├── img │ └── note.png └── README.md ├── Set Google Chrome Home, New Tab Page and Home Button ├── img │ └── note.png └── README.md ├── Stop Teams from running on startup in Windows 11 ├── img │ └── request.png └── README.md ├── Set Microsoft Edge Home, New Tab Page and Home Button ├── img │ └── note.png └── README.md ├── Disable Microsoft Edge Personalize your web experience ├── img │ └── popup.png └── README.md ├── Disable Google Chrome Turn on an ad privacy feature ├── img │ └── privacysandbox.png └── README.md ├── Windows 11 disable privacy experience for new users ├── img │ └── privacySettings.png └── README.md ├── Disable feature recommendations and browser assistance notifications in Microsoft Edge ├── img │ └── notification.png └── README.md ├── Firefox disable pocket └── README.md ├── Firefox disable new tab page └── README.md ├── Firefox enable menu bar └── README.md ├── Firefox remove default bookmarks └── README.md ├── Brave Browser disable Tor └── README.md ├── Firefox disable Firefox Accounts └── README.md ├── Disable Microsoft Edge Collections └── README.md ├── Disable Microsoft Edge Hubs Side bar └── README.md ├── Disable Microsoft Edge split screen └── README.md ├── Firefox dont check default browser └── README.md ├── Disable Microsoft Edge DNS over HTTPS └── README.md ├── Brave Browser disable Brave VPN └── README.md ├── Disable Microsoft Edge first run wizard └── README.md ├── Firefox enable bookmarks bar └── README.md ├── Google Chrome show bookmarks bar └── README.md ├── Microsoft Edge show favorites bar └── README.md ├── Disable Microsoft Edge Shopping Assistant └── README.md ├── Brave Browser disable Brave Wallet └── README.md ├── Brave Browser disable Brave Rewards └── README.md ├── Microsoft Edge remove Import Favorites button └── README.md ├── Microsoft Edge show the Downloads button on the toolbar └── README.md ├── Remove Microsoft Edge Browser Essentials Toolbar Button └── README.md ├── Change Right Click Mouse Context Menu └── README.md ├── Firefox disable DNS over HTTPS └── README.md ├── Firefox disable first run page and default bookmarks └── README.md ├── Windows 11 disable widgets in taskbar └── README.md ├── Windows 11 hide Task View in taskbar └── README.md ├── Windows 11 pin software to taskbar ├── taskbar.xml └── README.md ├── Block Brave Browser access to a list of URLs └── README.md ├── Stop Windows Update from updating drivers └── README.md ├── Block Microsoft Edge access to a list of URLs └── Block Google Chrome access to a list of URLs │ └── README.md ├── Disable Google Chrome website notifications └── README.md ├── Google Chrome disable DNS over HTTPS └── README.md ├── Disable Brave Browser DNS over HTTPS └── README.md ├── Configure Microsoft Edge Start page └── README.md ├── Firefox deploy Extension └── README.md ├── Prevent extensions from being disabled or removed └── README.md ├── Firefox block access to a list of URLs └── README.md ├── Install Google Chrome Extensions └── README.md ├── Rename-Computer └── README.md ├── Block Google Chrome access to a list of URLs └── README.md ├── Configure Microsoft Edge Start page quick links └── README.md ├── Manage Microsoft Edge Search Engines └── README.md ├── Firefox set Home page and enable Home button └── README.md ├── Install Microsoft Edge add-ons └── README.md ├── Brave Browser allow only certain pages └── README.md ├── Microsoft Edge allow only certain pages └── README.md ├── Get-WinSystemLocale, Set-WinSystemLocale └── README.md ├── Windows 11 set default applications for new users └── README.md ├── Brave Browser force install Progressive Web Apps └── README.md ├── Google Chrome force install Progressive Web Apps (PWA) └── README.md ├── Google Chrome allow only certain pages └── README.md ├── Deploy Brave Browser bookmarks └── README.md ├── Firefox deploy managed bookmarks └── README.md ├── Firefox allow only certain web pages └── README.md ├── Set Google Chrome as Default browser └── README.md ├── Windows 11 remove chat from taskbar └── README.md ├── Windows 11 remove copilot from taskbar └── README.md ├── Get-WinHomeLocation, Set-WinHomeLocation └── README.md ├── Get-Culture, Set-Culture └── README.md ├── Windows 11 remove search bar └── README.md ├── Get-TimeZone, Set-TimeZone └── README.md ├── Windows 11 move taskbar icons to left └── README.md ├── Windows 11 Configure regional settings └── README.md ├── Firefox disable quick links in Home page └── README.md ├── Deploy Microsoft Edge favorites └── README.md ├── Remove Home and Gallery from File Explorer └── README.md ├── Windows 11 remove Learn about this picture └── README.md ├── Get-WinUserLanguageList, Set-WinUserLanguageList └── README.md ├── Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage └── README.md ├── Deploy Google Chrome bookmarks └── README.md ├── Configure Microsoft Edge KIOSK └── README.md ├── Pin folder to File Explorers side bar └── README.md ├── Microsoft Edge force install Progressive Web Apps (PWA) └── README.md ├── Configure Windows auto logon registry settings └── README.md ├── Firefox deploy bookmarks └── README.md ├── Export-StartLayout, Import-StartLayout alternatives for Windows 11 └── README.md ├── Pause Windows 11 updates └── README.md ├── Enable This PC, Recycle Bin, User's Files, Control Panel and Network Desktop Icons └── README.md ├── Get-LocalUser, New-LocalUser, Set-LocalUser, Disable-LocalUser and Enable, Remove └── README.md ├── Configure Privacy and Security App permissions settings └── README.md ├── Using Get-AppxProvisionedPackage, Remove-AppxProvisionedPackage to modify Online image └── README.md └── Get-AppxPackage, Remove-AppxPackage └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | todo.txt 2 | run.ps1 3 | README_old.md 4 | */meta.txt 5 | _* -------------------------------------------------------------------------------- /Windows 11 configure wallpaper/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Windows 11 configure wallpaper/wallpaper.png -------------------------------------------------------------------------------- /Configure HKLM Run and RunOnce/script.ps1: -------------------------------------------------------------------------------- 1 | $write_hello_world = @{ 2 | Object = 'Hello world!' 3 | } 4 | Write-Host @write_hello_world 5 | 6 | Read-Host -------------------------------------------------------------------------------- /Creating viewer requested script 02/wallpaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Creating viewer requested script 02/wallpaper.png -------------------------------------------------------------------------------- /Firefox change default search engine/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Firefox change default search engine/img/note.png -------------------------------------------------------------------------------- /Brave Browser open web pages on startup/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Brave Browser open web pages on startup/img/note.png -------------------------------------------------------------------------------- /Creating viewer requested script 01/img/request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Creating viewer requested script 01/img/request.png -------------------------------------------------------------------------------- /Creating viewer requested script 02/img/request1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Creating viewer requested script 02/img/request1.png -------------------------------------------------------------------------------- /Creating viewer requested script 03/img/request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Creating viewer requested script 03/img/request.png -------------------------------------------------------------------------------- /Google Chrome open web pages on startup/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Google Chrome open web pages on startup/img/note.png -------------------------------------------------------------------------------- /Microsoft Edge open web pages on startup/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Microsoft Edge open web pages on startup/img/note.png -------------------------------------------------------------------------------- /Set default Brave Browser search provider/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Set default Brave Browser search provider/img/note.png -------------------------------------------------------------------------------- /Set default Google Chrome search provider/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Set default Google Chrome search provider/img/note.png -------------------------------------------------------------------------------- /Google Chrome disable first run pop-up windows/img/signin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Google Chrome disable first run pop-up windows/img/signin.png -------------------------------------------------------------------------------- /Windows 11 configure Start layout more pins/img/objective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Windows 11 configure Start layout more pins/img/objective.png -------------------------------------------------------------------------------- /Windows 11 configure Start personalizations/img/objective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Windows 11 configure Start personalizations/img/objective.png -------------------------------------------------------------------------------- /Windows 11 configure start menu folder icons/img/objective.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Windows 11 configure start menu folder icons/img/objective.png -------------------------------------------------------------------------------- /Set Brave Browser Home, New Tab Page and Home Button/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Set Brave Browser Home, New Tab Page and Home Button/img/note.png -------------------------------------------------------------------------------- /Set Google Chrome Home, New Tab Page and Home Button/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Set Google Chrome Home, New Tab Page and Home Button/img/note.png -------------------------------------------------------------------------------- /Stop Teams from running on startup in Windows 11/img/request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Stop Teams from running on startup in Windows 11/img/request.png -------------------------------------------------------------------------------- /Set Microsoft Edge Home, New Tab Page and Home Button/img/note.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Set Microsoft Edge Home, New Tab Page and Home Button/img/note.png -------------------------------------------------------------------------------- /Disable Microsoft Edge Personalize your web experience/img/popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Disable Microsoft Edge Personalize your web experience/img/popup.png -------------------------------------------------------------------------------- /Google Chrome disable first run pop-up windows/img/privacysandbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Google Chrome disable first run pop-up windows/img/privacysandbox.png -------------------------------------------------------------------------------- /Disable Google Chrome Turn on an ad privacy feature/img/privacysandbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Disable Google Chrome Turn on an ad privacy feature/img/privacysandbox.png -------------------------------------------------------------------------------- /Windows 11 disable privacy experience for new users/img/privacySettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Windows 11 disable privacy experience for new users/img/privacySettings.png -------------------------------------------------------------------------------- /Disable feature recommendations and browser assistance notifications in Microsoft Edge/img/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letsdoautomation/powershell/HEAD/Disable feature recommendations and browser assistance notifications in Microsoft Edge/img/notification.png -------------------------------------------------------------------------------- /Firefox disable pocket/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox disable pocket 2 | 3 | Objective: 4 | 5 | * Firefox disable pocket 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 1 14 | Name = "DisablePocket" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Firefox disable new tab page/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox disable new tab page 2 | 3 | Objective: 4 | 5 | * Firefox disable new tab page 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 0 14 | Name = "NewTabPage" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Firefox enable menu bar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox enable menu bar 2 | 3 | Objective: 4 | 5 | * Firefox enable menu bar 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = "always" # never 14 | Name = "DisplayMenuBar" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Firefox remove default bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox remove default bookmarks 2 | 3 | Objective: 4 | 5 | * Firefox remove default bookmarks 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 1 14 | Name = "NoDefaultBookmarks" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Brave Browser disable Tor/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Brave Browser disable Tor 2 | 3 | Objectives: 4 | 5 | * Brave Browser disable Tor 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 13 | Value = 1 # 0 - Enable, 1 - Disable 14 | Name = "TorDisabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Firefox disable Firefox Accounts/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox disable Firefox Accounts 2 | 3 | Objective: 4 | 5 | * Firefox disable Firefox Accounts 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 1 14 | Name = "DisableFirefoxAccounts" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge Collections/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Microsoft Edge Collections 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge Collections 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 0 14 | Name = "EdgeCollectionsEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge Hubs Side bar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Microsoft Edge Hubs Side bar 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge Hubs Side bar 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 0 14 | Name = "HubsSidebarEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge split screen/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Microsoft Edge split screen 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge split screen 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 0 14 | Name = "SplitScreenEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Firefox dont check default browser/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox dont check default browser 2 | 3 | Objective: 4 | 5 | * Firefox dont check default browser 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 1 14 | Name = "DontCheckDefaultBrowser" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge DNS over HTTPS/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Microsoft Edge DNS over HTTPS 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge DNS over HTTPS 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = "off" 14 | Name = "DnsOverHttpsMode" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Brave Browser disable Brave VPN/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Brave Browser disable Brave VPN 2 | 3 | Objectives: 4 | 5 | * Brave Browser disable Brave VPN 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 13 | Value = 1 # 0 - Enable, 1 - Disable 14 | Name = "BraveVPNDisabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge first run wizard/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Microsoft Edge first run wizard 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge first run wizard 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 1 14 | Name = "HideFirstRunExperience" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Firefox enable bookmarks bar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox enable bookmarks bar 2 | 3 | Objective: 4 | 5 | * Firefox enable bookmarks bar 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = "always" # never, always, newtab 14 | Name = "DisplayBookmarksToolbar" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Google Chrome show bookmarks bar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Google Chrome show bookmarks bar 2 | 3 | Objective: 4 | 5 | * Google Chrome show bookmarks bar 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Google\Chrome" 13 | Value = 1 # 1 - Enable, 0 - Disable 14 | Name = "BookmarkBarEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Microsoft Edge show favorites bar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Microsoft Edge show favorites bar 2 | 3 | Objective: 4 | 5 | * Microsoft Edge show favorites bar 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 1 # 1 - Enable, 0 - Disable 14 | Name = "FavoritesBarEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge Shopping Assistant/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Microsoft Edge Shopping Assistant 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge Shopping Assistant 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 0 14 | Name = "EdgeShoppingAssistantEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Brave Browser disable Brave Wallet/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Brave Browser disable Brave Wallet 2 | 3 | Objectives: 4 | 5 | * Brave Browser disable Brave Wallet 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 13 | Value = 1 # 0 - Enable, 1 - Disable 14 | Name = "BraveWalletDisabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Brave Browser disable Brave Rewards/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Brave Browser disable Brave Rewards 2 | 3 | Objectives: 4 | 5 | * Brave Browser disable Brave Rewards 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 13 | Value = 1 # 0 - Enable, 1 - Disable 14 | Name = "BraveRewardsDisabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Microsoft Edge remove Import Favorites button/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Microsoft Edge remove Import Favorites button 2 | 3 | Objective: 4 | 5 | * Microsoft Edge remove Import Favorites button 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 0 # 1 - Enable, 0 - Disable 14 | Name = "ImportFavorites" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Microsoft Edge show the Downloads button on the toolbar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Microsoft Edge show the Downloads button on the toolbar 2 | 3 | Objective: 4 | 5 | * Microsoft Edge show the Downloads button on the toolbar 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 1 14 | Name = "ShowDownloadsToolbarButton" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Remove Microsoft Edge Browser Essentials Toolbar Button/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Remove Microsoft Edge Browser Essentials Toolbar Button 2 | 3 | Objective: 4 | 5 | * Remove Microsoft Edge Browser Essentials Toolbar Button 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 0 14 | Name = "PinBrowserEssentialsToolbarButton" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | -------------------------------------------------------------------------------- /Disable Microsoft Edge Personalize your web experience/README.md: -------------------------------------------------------------------------------- 1 | # Disable Microsoft Edge Personalize your web experience 2 | 3 | Objective: 4 | 5 | * Disable Microsoft Edge Personalize your web experience 6 | 7 | 8 | 9 | PowerShell snippet: 10 | 11 | ```powershell 12 | $settings = 13 | [PSCustomObject]@{ 14 | Path = "SOFTWARE\Policies\Microsoft\Edge" 15 | Value = 0 16 | Name = "PersonalizationReportingEnabled" 17 | } | group Path 18 | 19 | foreach($setting in $settings){ 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 21 | if ($null -eq $registry) { 22 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 23 | } 24 | $setting.Group | %{ 25 | $registry.SetValue($_.name, $_.value) 26 | } 27 | $registry.Dispose() 28 | } 29 | ``` 30 | -------------------------------------------------------------------------------- /Change Right Click Mouse Context Menu/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Change Right Click Mouse Context Menu 2 | 3 | Objectives: 4 | 5 | * Change right click for single user 6 | * Change right click for all users 7 | 8 | Enable old right click for single user: 9 | 10 | ```powershell 11 | ni "HKCU:\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" -Value "" -Force 12 | ``` 13 | 14 | Enable old right click for all users: 15 | 16 | ```powershell 17 | ni "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\EnableOldRightClick" | New-ItemProperty -Name "StubPath" -Value 'REG ADD "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve' 18 | ``` 19 | 20 | ## Related videos 21 | 22 | Windows Registry 23 | 24 | [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw)
25 | [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) -------------------------------------------------------------------------------- /Firefox disable DNS over HTTPS/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox disable DNS over HTTPS 2 | 3 | Objective: 4 | 5 | * Firefox disable DNS over HTTPS 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox\DNSOverHTTPS" 13 | Value = 0 # 0 | 1 14 | Name = "Enabled" 15 | }, 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Policies\Mozilla\Firefox\DNSOverHTTPS" 18 | Value = 1 # 0 | 1 19 | Name = "Locked" 20 | } | group Path 21 | 22 | foreach($setting in $settings){ 23 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 24 | if ($null -eq $registry) { 25 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 26 | } 27 | $setting.Group | %{ 28 | $registry.SetValue($_.name, $_.value) 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /Firefox disable first run page and default bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox disable first run page and default bookmarks 2 | 3 | Objective: 4 | 5 | * Firefox disable first run page and default bookmarks 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 1 14 | Name = "NoDefaultBookmarks" 15 | }, 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 18 | Value = "" 19 | Name = "OverrideFirstRunPage" 20 | } | group Path 21 | 22 | foreach($setting in $settings){ 23 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 24 | if ($null -eq $registry) { 25 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 26 | } 27 | $setting.Group | %{ 28 | $registry.SetValue($_.name, $_.value) 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | -------------------------------------------------------------------------------- /Windows 11 disable widgets in taskbar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 disable widgets in taskbar 2 | 3 | ```powershell 4 | $settings = [PSCustomObject]@{ 5 | Path = "SOFTWARE\Policies\Microsoft\Dsh" 6 | Value = 0 7 | Name = "AllowNewsAndInterests" 8 | } | group Path 9 | 10 | foreach ($setting in $settings) { 11 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 12 | if ($null -eq $registry) { 13 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 14 | } 15 | $setting.Group | % { 16 | if (!$_.Type) { 17 | $registry.SetValue($_.name, $_.value) 18 | } 19 | else { 20 | $registry.SetValue($_.name, $_.value, $_.type) 21 | } 22 | } 23 | $registry.Dispose() 24 | } 25 | ``` 26 | 27 | ## Related videos 28 | 29 | Other powershell videos 30 | 31 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Windows 11 hide Task View in taskbar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 hide Task View in taskbar 2 | 3 | ```powershell 4 | $settings = [PSCustomObject]@{ 5 | Path = "SOFTWARE\Policies\Microsoft\Windows\Explorer" 6 | Value = 1 7 | Name = "HideTaskViewButton" 8 | } | group Path 9 | 10 | foreach ($setting in $settings) { 11 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 12 | if ($null -eq $registry) { 13 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 14 | } 15 | $setting.Group | % { 16 | if (!$_.Type) { 17 | $registry.SetValue($_.name, $_.value) 18 | } 19 | else { 20 | $registry.SetValue($_.name, $_.value, $_.type) 21 | } 22 | } 23 | $registry.Dispose() 24 | } 25 | ``` 26 | 27 | ## Related videos 28 | 29 | Other powershell videos 30 | 31 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Windows 11 pin software to taskbar/taskbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Windows 11 disable privacy experience for new users/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 disable privacy experience for new users 2 | 3 | Privacy experience window: 4 | 5 | 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Windows\OOBE" 13 | Name = "DisablePrivacyExperience" 14 | Value = 1 15 | } | group Path 16 | 17 | foreach ($setting in $settings) { 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | % { 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | 29 | ## Related videos 30 | 31 | Other powershell videos 32 | 33 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Block Brave Browser access to a list of URLs/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Block Brave Browser access to a list of URLs 2 | 3 | Objectives: 4 | 5 | * Block Brave Browser access to a list of URLs 6 | * facebook 7 | * instagram 8 | 9 | PowerShell snippet: 10 | 11 | ```powershell 12 | $settings = 13 | [PSCustomObject]@{ # block facebook 14 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\URLBlocklist" 15 | Value = "facebook.com" 16 | Name = ++$count 17 | }, 18 | [PSCustomObject]@{ # block instagram 19 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\URLBlocklist" 20 | Value = "instagram.com" 21 | Name = ++$count 22 | } | group Path 23 | 24 | foreach($setting in $settings){ 25 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 26 | if ($null -eq $registry) { 27 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 28 | } 29 | $setting.Group | %{ 30 | $registry.SetValue($_.name, $_.value) 31 | } 32 | $registry.Dispose() 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /Disable feature recommendations and browser assistance notifications in Microsoft Edge/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable feature recommendations and browser assistance notifications in Microsoft Edge 2 | 3 | Objective: 4 | 5 | * Disable feature recommendations and browser assistance notifications in Microsoft Edge 6 | 7 | 8 | 9 | Notes: Works for Windows Pro and Enterprise
10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\Microsoft\Edge" 17 | Value = 0 18 | Name = "ShowRecommendationsEnabled" 19 | } | group Path 20 | 21 | foreach($setting in $settings){ 22 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 23 | if ($null -eq $registry) { 24 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 25 | } 26 | $setting.Group | %{ 27 | $registry.SetValue($_.name, $_.value) 28 | } 29 | $registry.Dispose() 30 | } 31 | ``` -------------------------------------------------------------------------------- /Stop Windows Update from updating drivers/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Stop Windows Update from updating drivers 2 | 3 | Objective: 4 | 5 | * Stop Windows Update from updating drivers 6 | 7 | ```powershell 8 | $settings = 9 | [PSCustomObject]@{ 10 | Path = "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" 11 | Name = "ExcludeWUDriversInQualityUpdate" 12 | Value = 1 13 | } 14 | 15 | foreach ($setting in ($settings | group Path)) { 16 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 17 | if ($null -eq $registry) { 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 19 | } 20 | $setting.Group | % { 21 | $registry.SetValue($_.name, $_.value) 22 | } 23 | $registry.Dispose() 24 | } 25 | ``` 26 | 27 | ## Related videos 28 | 29 | Other powershell videos: 30 | 31 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 32 | * [Windows Registry](https://www.youtube.com/playlist?list=PLVncjTDMNQ4TZrwwuYuZBZhpjs6YWw7sQ) -------------------------------------------------------------------------------- /Block Microsoft Edge access to a list of URLs/Block Google Chrome access to a list of URLs/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Block Microsoft Edge access to a list of URLs 2 | 3 | Objectives: 4 | 5 | * Block Microsoft Edge access to a list of URLs 6 | * facebook 7 | * instagram 8 | 9 | PowerShell snippet: 10 | 11 | ```powershell 12 | $settings = 13 | [PSCustomObject]@{ # block facebook 14 | Path = "SOFTWARE\Policies\Microsoft\Edge\URLBlocklist" 15 | Value = "facebook.com" 16 | Name = ++$count 17 | }, 18 | [PSCustomObject]@{ # block instagram 19 | Path = "SOFTWARE\Policies\Microsoft\Edge\URLBlocklist" 20 | Value = "instagram.com" 21 | Name = ++$count 22 | } | group Path 23 | 24 | foreach($setting in $settings){ 25 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 26 | if ($null -eq $registry) { 27 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 28 | } 29 | $setting.Group | %{ 30 | $registry.SetValue($_.name, $_.value) 31 | } 32 | $registry.Dispose() 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /Google Chrome disable first run pop-up windows/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Google Chrome disable first run pop-up windows 2 | 3 | "Sign in to Chrome" screen: 4 | 5 | 6 | 7 | Disable sign in screen: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Google\Chrome" 13 | Value = 0 14 | Name = "PromotionsEnabled" 15 | } | group Path 16 | 17 | foreach($setting in $settings){ 18 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | %{ 23 | $registry.SetValue($_.name, $_.value) 24 | } 25 | $registry.Dispose() 26 | } 27 | ``` 28 | 29 | ## Related videos 30 | 31 | Other powershell videos 32 | 33 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A)
34 | [Google Chrome playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4TOfhZyNOqTyrpRS6HXFqjW) 35 | -------------------------------------------------------------------------------- /Disable Google Chrome website notifications/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Google Chrome website notifications 2 | 3 | Links: 4 | 5 | * [bennish web-notifications](https://www.bennish.net/web-notifications.html) 6 | 7 | Objective: 8 | 9 | * Disable Google Chrome website notifications 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | 15 | # 1 - Allow sites to show desktop notifications 16 | # 2 - Do not allow any site to show desktop notifications 17 | # 3 - Ask every time a site wants to show desktop notifications 18 | 19 | $settings = 20 | [PSCustomObject]@{ 21 | Path = "SOFTWARE\Policies\Google\Chrome" 22 | Value = 2 23 | Name = "DefaultNotificationsSetting" 24 | } | group Path 25 | 26 | foreach($setting in $settings){ 27 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 28 | if ($null -eq $registry) { 29 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 30 | } 31 | $setting.Group | %{ 32 | $registry.SetValue($_.name, $_.value) 33 | } 34 | $registry.Dispose() 35 | } 36 | ``` 37 | -------------------------------------------------------------------------------- /Google Chrome disable DNS over HTTPS/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Google Chrome disable DNS over HTTPS 2 | 3 | Objectives: 4 | 5 | * Google Chrome disable DNS over HTTPS 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | # secure - The "secure" mode will only send DNS-over-HTTPS queries and will fail to resolve on error. 11 | # automatic -The "automatic" mode will send DNS-over-HTTPS queries first if a DNS-over-HTTPS server is available and may fallback to sending insecure queries on error. 12 | # off - The "off" mode will disable DNS-over-HTTPS. 13 | $settings = 14 | [PSCustomObject]@{ 15 | Path = "SOFTWARE\Policies\Google\Chrome" 16 | Value = "off" # secure, automatic or off 17 | Name = "DnsOverHttpsMode" 18 | } | group Path 19 | 20 | foreach($setting in $settings){ 21 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 22 | if ($null -eq $registry) { 23 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 24 | } 25 | $setting.Group | %{ 26 | $registry.SetValue($_.name, $_.value) 27 | } 28 | $registry.Dispose() 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /Disable Brave Browser DNS over HTTPS/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Brave Browser DNS over HTTPS 2 | 3 | Objectives: 4 | 5 | * Disable Brave Browser DNS over HTTPS 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | # secure - The "secure" mode will only send DNS-over-HTTPS queries and will fail to resolve on error. 11 | # automatic -The "automatic" mode will send DNS-over-HTTPS queries first if a DNS-over-HTTPS server is available and may fallback to sending insecure queries on error. 12 | # off - The "off" mode will disable DNS-over-HTTPS. 13 | $settings = 14 | [PSCustomObject]@{ 15 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 16 | Value = "off" # secure, automatic or off 17 | Name = "DnsOverHttpsMode" 18 | } | group Path 19 | 20 | foreach($setting in $settings){ 21 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 22 | if ($null -eq $registry) { 23 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 24 | } 25 | $setting.Group | %{ 26 | $registry.SetValue($_.name, $_.value) 27 | } 28 | $registry.Dispose() 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /Configure Microsoft Edge Start page/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Configure Microsoft Edge Start page 2 | 3 | Objectives: 4 | 5 | * Configure Microsoft Edge Start page 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Microsoft\Edge" 13 | Value = 3 # Remove background 14 | Name = "NewTabPageAllowedBackgroundTypes" 15 | }, 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Policies\Microsoft\Edge" 18 | Value = 0 # Disable APP launcher 19 | Name = "NewTabPageAppLauncherEnabled" 20 | }, 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Policies\Microsoft\Edge" 23 | Value = 0 # Remove news and other stuff 24 | Name = "NewTabPageContentEnabled" 25 | } | group Path 26 | 27 | foreach($setting in $settings){ 28 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 29 | if ($null -eq $registry) { 30 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 31 | } 32 | $setting.Group | %{ 33 | $registry.SetValue($_.name, $_.value) 34 | } 35 | $registry.Dispose() 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /Firefox deploy Extension/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox deploy Extension 2 | 3 | Objective: 4 | 5 | * Firefox deploy Extension 6 | * [Firefox add-ons](https://addons.mozilla.org/en-US/firefox/extensions/) 7 | 8 | PowerShell snippet: 9 | 10 | ```powershell 11 | $settings = 12 | [PSCustomObject]@{ 13 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Extensions\Install" 14 | Value = "https://addons.mozilla.org/firefox/downloads/file/4216633/ublock_origin-1.55.0.xpi" 15 | Name = ++$count 16 | }, 17 | [PSCustomObject]@{ 18 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Extensions\Install" 19 | Value = "https://addons.mozilla.org/firefox/downloads/file/4211087/bitwarden_password_manager-2023.12.1.xpi" 20 | Name = ++$count 21 | } | group Path 22 | 23 | foreach($setting in $settings){ 24 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 25 | if ($null -eq $registry) { 26 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 27 | } 28 | $setting.Group | %{ 29 | $registry.SetValue($_.name, $_.value) 30 | } 31 | $registry.Dispose() 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /Prevent extensions from being disabled or removed/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Prevent extensions from being disabled or removed 2 | 3 | PowerShell snippet for locking extension: 4 | 5 | ```powershell 6 | $settings = 7 | [PSCustomObject]@{ 8 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Extensions\Locked" 9 | Value = "{54e2eb33-18eb-46ad-a4e4-1329c29f6e17}" 10 | Name = ++$count 11 | } | group Path 12 | 13 | foreach($setting in $settings){ 14 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 15 | if ($null -eq $registry) { 16 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 17 | } 18 | $setting.Group | %{ 19 | $registry.SetValue($_.name, $_.value) 20 | } 21 | $registry.Dispose() 22 | } 23 | ``` 24 | 25 | PowerShell snippet for finding guid: 26 | 27 | ```powershell 28 | $extension = "Block Site" 29 | $result = irm "https://addons.mozilla.org/api/v5/addons/search/?q=$($extension)" 30 | 31 | foreach($item in $result.results){ 32 | [PSCustomObject]@{ 33 | name = $item.name.'en-us' 34 | guid = $item.guid 35 | url = $item.url 36 | } 37 | } 38 | ``` -------------------------------------------------------------------------------- /Firefox block access to a list of URLs/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox block access to a list of URLs 2 | 3 | Documentation: 4 | 5 | * [Match Patterns](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) 6 | 7 | Objective: 8 | 9 | * Firefox block access to a list of URLs 10 | * facebook 11 | * instagram 12 | 13 | PowerShell snippet: 14 | 15 | ```powershell 16 | $settings = 17 | [PSCustomObject]@{ # block facebook 18 | Path = "SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Block" 19 | Value = "*://*.facebook.com/*" 20 | Name = ++$count 21 | }, 22 | [PSCustomObject]@{ # block instagram 23 | Path = "SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Block" 24 | Value = "*://*.instagram.com/*" 25 | Name = ++$count 26 | } | group Path 27 | 28 | foreach($setting in $settings){ 29 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 30 | if ($null -eq $registry) { 31 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 32 | } 33 | $setting.Group | %{ 34 | $registry.SetValue($_.name, $_.value) 35 | } 36 | $registry.Dispose() 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /Install Google Chrome Extensions/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Install Google Chrome Extensions 2 | ### Documentation and download 3 | Documentation links: 4 | 5 | * [Alternative extension installation methods](https://developer.chrome.com/docs/extensions/how-to/distribute/install-extensions) 6 | 7 | Objectives: 8 | 9 | * Install chrome extensions 10 | 11 | Extension store: 12 | 13 | * [Chrome Webstore](https://chromewebstore.google.com/category/extensions) 14 | 15 | ```powershell 16 | $extensions = '' 17 | $key_path = "Software\Policies\Google\Chrome\ExtensionInstallForcelist" 18 | 19 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($key_path, $true) 20 | 21 | $extensions | %{ 22 | if($null -eq $registry){ 23 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($key_path, $true) 24 | $registry.SetValue("1", $_) 25 | } 26 | else{ 27 | $values = $registry.GetValueNames().ForEach({$registry.GetValue($_)}) 28 | if($_ -notin $values){ 29 | $maximum = $registry.GetValueNames().Where({$_ -match "\d"}) | measure -maximum | select -expand maximum 30 | $maximum += 1 31 | $registry.SetValue($maximum, $_) 32 | } 33 | } 34 | } 35 | 36 | $registry.Dispose() 37 | ``` -------------------------------------------------------------------------------- /Rename-Computer/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Rename-Computer 2 | 3 | Documentation: 4 | 5 | * [Rename-Computer](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-computer?view=powershell-5.1) 6 | 7 | Get current computer name: 8 | 9 | ```powershell 10 | $env:COMPUTERNAME 11 | ``` 12 | 13 | Rename computer: 14 | 15 | ```powershell 16 | Rename-Computer -NewName "computer01" 17 | ``` 18 | 19 | Rename and restart: 20 | 21 | ```powershell 22 | Rename-Computer -NewName "computer01" -Restart 23 | ``` 24 | 25 | Set computer name from user input: 26 | 27 | ```powershell 28 | Add-Type -AssemblyName Microsoft.VisualBasic 29 | 30 | $computer_name = [Microsoft.VisualBasic.Interaction]::InputBox("Enter new computer name:", "Configure computername") 31 | 32 | if(![string]::IsNullOrEmpty($computer_name)){ 33 | Rename-Computer -NewName $computer_name 34 | } 35 | ``` 36 | 37 | Use computer serial number as computer name: 38 | 39 | ```powershell 40 | # For OEM computers like Dell, Lenovo, HP, etc only 41 | 42 | $serial = "PC-{0}" -f ((gwmi -class win32_bios).SerialNumber -replace " ") 43 | 44 | if($serial.length -gt 15){ 45 | $serial = $serial.SubString(0, 14) 46 | } 47 | 48 | Rename-Computer -NewName $serial 49 | ``` -------------------------------------------------------------------------------- /Block Google Chrome access to a list of URLs/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Block Google Chrome access to a list of URLs 2 | 3 | Documentation: 4 | 5 | * [URL blocklist filter format](https://support.google.com/chrome/a/answer/9942583?visit_id=638395414883072846-3752810819&p=url_blocklist_filter_format&rd=1#zippy=%2Curl-blocklist-examples) 6 | 7 | Objectives: 8 | 9 | * Block Google Chrome access to a list of URLs 10 | * facebook 11 | * instagram 12 | 13 | PowerShell snippet: 14 | 15 | ```powershell 16 | $settings = 17 | [PSCustomObject]@{ # block facebook 18 | Path = "SOFTWARE\Policies\Google\Chrome\URLBlocklist" 19 | Value = "facebook.com" 20 | Name = ++$count 21 | }, 22 | [PSCustomObject]@{ # block instagram 23 | Path = "SOFTWARE\Policies\Google\Chrome\URLBlocklist" 24 | Value = "instagram.com" 25 | Name = ++$count 26 | } | group Path 27 | 28 | foreach($setting in $settings){ 29 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 30 | if ($null -eq $registry) { 31 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 32 | } 33 | $setting.Group | %{ 34 | $registry.SetValue($_.name, $_.value) 35 | } 36 | $registry.Dispose() 37 | } 38 | ``` 39 | -------------------------------------------------------------------------------- /Configure Microsoft Edge Start page quick links/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Configure Microsoft Edge Start page quick links 2 | 3 | Objectives: 4 | 5 | * Configure Microsoft Edge Start page quick links 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $links = 11 | ConvertTo-Json @( 12 | @{ 13 | url = "https://google.com" 14 | title = "Google" 15 | pinned = $true 16 | }, 17 | @{ 18 | url = "https://youtube.com" 19 | title = "Youtube" 20 | pinned = $true 21 | } 22 | ) -Compress 23 | 24 | $settings = 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Policies\Microsoft\Edge" 27 | Value = 1 # Remove default sites 28 | Name = "NewTabPageHideDefaultTopSites" 29 | }, 30 | [PSCustomObject]@{ 31 | Path = "SOFTWARE\Policies\Microsoft\Edge" 32 | Value = $links 33 | Name = "NewTabPageManagedQuickLinks" 34 | } | group Path 35 | 36 | foreach($setting in $settings){ 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 38 | if ($null -eq $registry) { 39 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 40 | } 41 | $setting.Group | %{ 42 | $registry.SetValue($_.name, $_.value) 43 | } 44 | $registry.Dispose() 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Google Chrome open web pages on startup/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Google Chrome open web pages on startup 2 | 3 | Objectives: 4 | 5 | * Google Chrome open web pages on startup 6 | 7 | Notes:
8 | 9 | 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\Google\Chrome" 17 | Value = 4 # 5 - Open New Tab Page, 18 | # 1 - Restore the last session, 19 | # 4 - Open a list of URLs 20 | Name = "RestoreOnStartup" 21 | }, 22 | [PSCustomObject]@{ 23 | Path = "SOFTWARE\Policies\Google\Chrome\RestoreOnStartupURLs" 24 | Value = "https://youtube.com" 25 | Name = ++$count 26 | }, 27 | [PSCustomObject]@{ 28 | Path = "SOFTWARE\Policies\Google\Chrome\RestoreOnStartupURLs" 29 | Value = "https://google.com" 30 | Name = ++$count 31 | } | group Path 32 | 33 | foreach($setting in $settings){ 34 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 35 | if ($null -eq $registry) { 36 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 37 | } 38 | $setting.Group | %{ 39 | $registry.SetValue($_.name, $_.value) 40 | } 41 | $registry.Dispose() 42 | } 43 | ``` 44 | -------------------------------------------------------------------------------- /Manage Microsoft Edge Search Engines/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Manage Microsoft Edge Search Engines 2 | 3 | Objective: 4 | 5 | * Manage Microsoft Edge Search Engines 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $search_engines = 11 | ConvertTo-Json @( 12 | @{ 13 | is_default = $true 14 | keyword = "duck" 15 | name = "duckduckgo.com" 16 | search_url = "https://duckduckgo.com/?q={searchTerms}" 17 | }, 18 | @{ 19 | keyword = "bing" 20 | name = "bing.com" 21 | search_url = "https://www.bing.com/search?q={searchTerms}" 22 | }, 23 | @{ 24 | keyword = "google" 25 | name = "google.com" 26 | search_url = "https://www.google.com/search?q={searchTerms}" 27 | } 28 | ) -Compress 29 | 30 | $settings = 31 | [PSCustomObject]@{ 32 | Path = "SOFTWARE\Policies\Microsoft\Edge" 33 | Value = $search_engines 34 | Name = "ManagedSearchEngines" 35 | } | group Path 36 | 37 | foreach($setting in $settings){ 38 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 39 | if ($null -eq $registry) { 40 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 41 | } 42 | $setting.Group | %{ 43 | $registry.SetValue($_.name, $_.value) 44 | } 45 | $registry.Dispose() 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Microsoft Edge open web pages on startup/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Microsoft Edge open web pages on startup 2 | 3 | Objectives: 4 | 5 | * Microsoft Edge open web pages on startup 6 | 7 | Notes: Works for Windows Pro and Enterprise
8 | 9 | 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\Microsoft\Edge" 17 | Value = 4 # 5 - Open New Tab Page, 18 | # 1 - Restore the last session, 19 | # 4 - Open a list of URLs 20 | Name = "RestoreOnStartup" 21 | }, 22 | [PSCustomObject]@{ 23 | Path = "SOFTWARE\Policies\Microsoft\Edge\RestoreOnStartupURLs" 24 | Value = "https://youtube.com" 25 | Name = ++$count 26 | }, 27 | [PSCustomObject]@{ 28 | Path = "SOFTWARE\Policies\Microsoft\Edge\RestoreOnStartupURLs" 29 | Value = "https://google.com" 30 | Name = ++$count 31 | } | group Path 32 | 33 | foreach($setting in $settings){ 34 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 35 | if ($null -eq $registry) { 36 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 37 | } 38 | $setting.Group | %{ 39 | $registry.SetValue($_.name, $_.value) 40 | } 41 | $registry.Dispose() 42 | } 43 | ``` -------------------------------------------------------------------------------- /Creating viewer requested script 02/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Creating viewer requested script 02 2 | 3 | Request: 4 | 5 | 6 | 7 | Snippet for configuring wallpaper settings: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" 13 | Name = "DesktopImageStatus" 14 | Value = 1 15 | }, 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" 18 | Name = "DesktopImagePath" 19 | Value = "C:\wallpaper.png" 20 | } 21 | 22 | foreach ($setting in ($settings | group Path)) { 23 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 24 | if ($null -eq $registry) { 25 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 26 | } 27 | $setting.Group | % { 28 | $registry.SetValue($_.name, $_.value) 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | 34 | ## Related videos 35 | 36 | Other powershell videos: 37 | 38 | * [Windows 11 configure wallpaper](https://youtu.be/DUsvqjA691Q) 39 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 40 | * [Windows Registry](https://www.youtube.com/playlist?list=PLVncjTDMNQ4TZrwwuYuZBZhpjs6YWw7sQ) 41 | -------------------------------------------------------------------------------- /Firefox set Home page and enable Home button/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox set Home page and enable Home button 2 | 3 | Objective: 4 | 5 | * Firefox set Home page and enable Home button 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 13 | Value = 1 # 1 | 0 14 | Name = "ShowHomeButton" # Enable home button 15 | }, 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Homepage" 18 | Value = "https://google.com" # homepage 19 | Name = "URL" 20 | }, 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Homepage" 23 | Value = "homepage" # homepage | none | previous-session | homepage-locked 24 | Name = "StartPage" 25 | }, 26 | [PSCustomObject]@{ 27 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Homepage" 28 | Value = 0 # 1 | 0 29 | Name = "Locked" # Allow to change homepage 30 | } | group Path 31 | 32 | foreach($setting in $settings){ 33 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 34 | if ($null -eq $registry) { 35 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 36 | } 37 | $setting.Group | %{ 38 | $registry.SetValue($_.name, $_.value) 39 | } 40 | $registry.Dispose() 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /Brave Browser open web pages on startup/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Brave Browser open web pages on startup 2 | 3 | Objectives: 4 | 5 | * Brave Browser open web pages on startup 6 | 7 | Notes: Works for Windows Pro and Enterprise
8 | 9 | 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 17 | Value = 4 # 5 - Open New Tab Page, 18 | # 1 - Restore the last session, 19 | # 4 - Open a list of URLs 20 | Name = "RestoreOnStartup" 21 | }, 22 | [PSCustomObject]@{ 23 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\RestoreOnStartupURLs" 24 | Value = "https://youtube.com" 25 | Name = ++$count 26 | }, 27 | [PSCustomObject]@{ 28 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\RestoreOnStartupURLs" 29 | Value = "https://google.com" 30 | Name = ++$count 31 | } | group Path 32 | 33 | foreach($setting in $settings){ 34 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 35 | if ($null -eq $registry) { 36 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 37 | } 38 | $setting.Group | %{ 39 | $registry.SetValue($_.name, $_.value) 40 | } 41 | $registry.Dispose() 42 | } 43 | ``` -------------------------------------------------------------------------------- /Install Microsoft Edge add-ons/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Install Microsoft Edge add-ons 2 | 3 | Objectives: 4 | 5 | * Install Microsoft Edge add-ons 6 | 7 | Extension store: 8 | 9 | * [Microsoft Edge Extensions](https://microsoftedge.microsoft.com/addons/Get-started-with-microsoft-edge-extensions) 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist" 17 | Value = "elhekieabhbkpmcefcoobjddigjcaadp" # Adobe Acrobat 18 | Name = ++$count 19 | }, 20 | [PSCustomObject]@{ 21 | Path = "SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist" 22 | Value = "cnlefmmeadmemmdciolhbnfeacpdfbkd" # Grammarly 23 | Name = ++$count 24 | }, 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist" 27 | Value = "odfafepnkmbhccpbejgmiehpchacaeak" # uBlock Origin 28 | Name = ++$count 29 | } | group Path 30 | 31 | foreach($setting in $settings){ 32 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 33 | if ($null -eq $registry) { 34 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 35 | } 36 | $setting.Group | %{ 37 | $registry.SetValue($_.name, $_.value) 38 | } 39 | $registry.Dispose() 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /Brave Browser allow only certain pages/README.md: -------------------------------------------------------------------------------- 1 | # Brave Browser allow only certain pages 2 | 3 | Objective: 4 | 5 | * Brave Browser allow only certain pages 6 | * Block everything 7 | * Allow google.com 8 | * Allow youtube.com 9 | * Allow duckduckgo.com 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ # block everything 16 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\URLBlocklist" 17 | Value = "*" 18 | Name = "1" 19 | }, 20 | [PSCustomObject]@{ # allow google.com 21 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\URLAllowlist" 22 | Value = "google.com" 23 | Name = ++$count 24 | }, 25 | [PSCustomObject]@{ # allow google.com 26 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\URLAllowlist" 27 | Value = "duckduckgo.com" 28 | Name = ++$count 29 | }, 30 | [PSCustomObject]@{ # allow youtube.com 31 | Path = "SOFTWARE\Policies\BraveSoftware\Brave\URLAllowlist" 32 | Value = "youtube.com" 33 | Name = ++$count 34 | } | group Path 35 | 36 | foreach($setting in $settings){ 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 38 | if ($null -eq $registry) { 39 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 40 | } 41 | $setting.Group | %{ 42 | $registry.SetValue($_.name, $_.value) 43 | } 44 | $registry.Dispose() 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Microsoft Edge allow only certain pages/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Microsoft Edge allow only certain pages 2 | 3 | Objective: 4 | 5 | * Microsoft Edge allow only certain pages 6 | * Block everything 7 | * Allow google.com 8 | * Allow youtube.com 9 | * Allow duckduckgo.com 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ # block everything 16 | Path = "SOFTWARE\Policies\Microsoft\Edge\URLBlocklist" 17 | Value = "*" 18 | Name = "1" 19 | }, 20 | [PSCustomObject]@{ # allow google.com 21 | Path = "SOFTWARE\Policies\Microsoft\Edge\URLAllowlist" 22 | Value = "google.com" 23 | Name = ++$count 24 | }, 25 | [PSCustomObject]@{ # allow duckduckgo.com 26 | Path = "SOFTWARE\Policies\Microsoft\Edge\URLAllowlist" 27 | Value = "duckduckgo.com" 28 | Name = ++$count 29 | }, 30 | [PSCustomObject]@{ # allow youtube.com 31 | Path = "SOFTWARE\Policies\Microsoft\Edge\URLAllowlist" 32 | Value = "youtube.com" 33 | Name = ++$count 34 | } | group Path 35 | 36 | foreach($setting in $settings){ 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 38 | if ($null -eq $registry) { 39 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 40 | } 41 | $setting.Group | %{ 42 | $registry.SetValue($_.name, $_.value) 43 | } 44 | $registry.Dispose() 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Get-WinSystemLocale, Set-WinSystemLocale/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-WinSystemLocale, Set-WinSystemLocale 2 | 3 | Documentation: 4 | 5 | [Get-WinSystemLocale](https://learn.microsoft.com/en-us/powershell/module/international/get-winsystemlocale?view=windowsserver2022-ps)
6 | [Set-WinSystemLocale](https://learn.microsoft.com/en-us/powershell/module/international/set-winsystemlocale?view=windowsserver2022-ps)
7 | [Default input profiles (input locales) in Windows](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs?view=windows-11) 8 | 9 | 10 | Get current system locale: 11 | 12 | ```powershell 13 | Get-WinSystemLocale 14 | ``` 15 | 16 | Set system locale to french: 17 | 18 | ```powershell 19 | Set-WinSystemLocale fr-FR 20 | ``` 21 | 22 | ### Related videos 23 | 24 | Regional powershell commands: 25 | 26 | [Get-Culture, Set-Culture](https://youtu.be/gS4BckaTKto)
27 | [Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage](https://youtu.be/eN-56mOM5GQ)
28 | [Get-TimeZone, Set-TimeZone](https://youtu.be/fmoIfJwvH-I)
29 | [Get-WinHomeLocation, Set-WinHomeLocation](https://youtu.be/yWp_1L8YDoQ)
30 | [Get-WinUserLanguageList, Set-WinUserLanguageList](https://youtu.be/Bhl-rLB8g28)
31 | 32 | Other powershell videos: 33 | 34 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Set Google Chrome Home, New Tab Page and Home Button/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Set Google Chrome Home, New Tab Page and Home Button 2 | 3 | Objectives: 4 | 5 | * Set Google Chrome Home, New Tab Page and Home Button 6 | 7 | Notes:
8 | 9 | 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\Google\Chrome" 17 | Value = "https://google.com" 18 | Name = "HomepageLocation" # set homepage 19 | }, 20 | [PSCustomObject]@{ 21 | Path = "SOFTWARE\Policies\Google\Chrome" 22 | Value = "https://duckduckgo.com/" 23 | Name = "NewTabPageLocation" # set new page 24 | }, 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Policies\Google\Chrome" 27 | Value = 0 # 1 - Enable, 2 - Disable 28 | Name = "HomepageIsNewTabPage" # home page same as new page 29 | }, 30 | [PSCustomObject]@{ 31 | Path = "SOFTWARE\Policies\Google\Chrome" 32 | Value = 1 # 1 - Enable, 2 - Disable 33 | Name = "ShowHomeButton" # Show home button 34 | } | group Path 35 | 36 | foreach($setting in $settings){ 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 38 | if ($null -eq $registry) { 39 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 40 | } 41 | $setting.Group | %{ 42 | $registry.SetValue($_.name, $_.value) 43 | } 44 | $registry.Dispose() 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /Disable Google Chrome Turn on an ad privacy feature/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Disable Google Chrome Turn on an ad privacy feature 2 | 3 | Objectives: 4 | 5 | * Disable Turn on an ad privacy feature message 6 | * Disable Privacy Sandbox Ad measurement 7 | * Disable Privacy Sandbox Ad topics 8 | * Disable Privacy Sandbox Site-suggested ads 9 | 10 | 11 | 12 | PowerShell snippet: 13 | 14 | ```powershell 15 | $settings = 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Policies\Google\Chrome" 18 | Value = 0 19 | Name = "PrivacySandboxPromptEnabled" # notification 20 | }, 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Policies\Google\Chrome" 23 | Value = 0 24 | Name = "PrivacySandboxAdMeasurementEnabled" 25 | }, 26 | [PSCustomObject]@{ 27 | Path = "SOFTWARE\Policies\Google\Chrome" 28 | Value = 0 29 | Name = "PrivacySandboxAdTopicsEnabled" 30 | }, 31 | [PSCustomObject]@{ 32 | Path = "SOFTWARE\Policies\Google\Chrome" 33 | Value = 0 34 | Name = "PrivacySandboxSiteEnabledAdsEnabled" 35 | } | group Path 36 | 37 | foreach($setting in $settings){ 38 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 39 | if ($null -eq $registry) { 40 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 41 | } 42 | $setting.Group | %{ 43 | $registry.SetValue($_.name, $_.value) 44 | } 45 | $registry.Dispose() 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /Set default Google Chrome search provider/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Change default Google Chrome search provider 2 | 3 | Objectives: 4 | 5 | * Change default Google Chrome search provider 6 | 7 | Notes:
8 | 9 | 10 | 11 | Providers:
12 | 13 | * google: https://www.google.com/search?q={searchTerms} 14 | * duckduckgo: https://duckduckgo.com/?q={searchTerms} 15 | * bing: https://www.bing.com/search?q={searchTerms} 16 | * yahoo: https://search.yahoo.com/search?p={searchTerms} 17 | * yandex: https://yandex.com/search/?text={searchTerms} 18 | 19 | PowerShell snippet: 20 | 21 | ```powershell 22 | $settings = 23 | [PSCustomObject]@{ # Enable default search providers 24 | Path = "SOFTWARE\Policies\Google\Chrome" 25 | Value = 1 26 | Name = "DefaultSearchProviderEnabled" 27 | }, 28 | [PSCustomObject]@{ # Set search provider url 29 | Path = "SOFTWARE\Policies\Google\Chrome" 30 | Value = "https://duckduckgo.com/?q={searchTerms}" 31 | Name = "DefaultSearchProviderSearchURL" 32 | } | group Path 33 | 34 | foreach($setting in $settings){ 35 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 36 | if ($null -eq $registry) { 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 38 | } 39 | $setting.Group | %{ 40 | $registry.SetValue($_.name, $_.value) 41 | } 42 | $registry.Dispose() 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /Windows 11 set default applications for new users/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 set default applications for new users 2 | 3 | Notes: 4 | 5 | * This method works only for NEW users on computer 6 | 7 | Objectives: 8 | 9 | * Create default app associations xml 10 | * Use app associations xml to: 11 | * Set Adobe Reader as default app for pdf files 12 | * Set Chrome as default browser 13 | 14 | Export curret default application list: 15 | 16 | ```powershell 17 | dism /online /Export-DefaultAppAssociations:"C:\associations.xml" 18 | ``` 19 | 20 | Set default programs for new users: 21 | 22 | ```powershell 23 | $associations_xml = @" 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | "@ 33 | 34 | $provisioning = ni "$($env:ProgramData)\provisioning" -ItemType Directory -Force 35 | 36 | $associations_xml | Out-File "$($provisioning.FullName)\associations.xml" -Encoding utf8 37 | 38 | dism /online /Import-DefaultAppAssociations:"$($provisioning.FullName)\associations.xml" 39 | ``` -------------------------------------------------------------------------------- /Brave Browser force install Progressive Web Apps/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Brave Browser force install Progressive Web Apps (PWA) 2 | 3 | Objective: 4 | 5 | * Brave Browser force install Progressive Web Apps (PWA) 6 | * Install Twitter 7 | * Install Telegram 8 | * Install Spotify 9 | 10 | PowerShell snippet: 11 | 12 | ```powershell 13 | $apps = 14 | ConvertTo-Json @( 15 | @{ 16 | create_desktop_shortcut = $true 17 | default_launch_container = "window" 18 | url = "https://twitter.com/" 19 | }, 20 | @{ 21 | create_desktop_shortcut = $true 22 | default_launch_container = "window" 23 | url = "https://web.telegram.org/" 24 | }, 25 | @{ 26 | create_desktop_shortcut = $true 27 | default_launch_container = "window" 28 | url = "https://open.spotify.com/" 29 | } 30 | ) -Compress 31 | 32 | $settings = 33 | [PSCustomObject]@{ 34 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 35 | Value = $apps 36 | Name = "WebAppInstallForceList" 37 | } | group Path 38 | 39 | foreach($setting in $settings){ 40 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 41 | if ($null -eq $registry) { 42 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 43 | } 44 | $setting.Group | %{ 45 | $registry.SetValue($_.name, $_.value) 46 | } 47 | $registry.Dispose() 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Google Chrome force install Progressive Web Apps (PWA)/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Google Chrome force install Progressive Web Apps (PWA) 2 | 3 | Objective: 4 | 5 | * Google Chrome force install Progressive Web Apps (PWA) 6 | * Install Twitter 7 | * Install Telegram 8 | * Install Spotify 9 | 10 | PowerShell snippet: 11 | 12 | ```powershell 13 | $apps = 14 | ConvertTo-Json @( 15 | @{ 16 | create_desktop_shortcut = $true 17 | default_launch_container = "window" 18 | url = "https://twitter.com/" 19 | }, 20 | @{ 21 | create_desktop_shortcut = $true 22 | default_launch_container = "window" 23 | url = "https://web.telegram.org/" 24 | }, 25 | @{ 26 | create_desktop_shortcut = $true 27 | default_launch_container = "window" 28 | url = "https://open.spotify.com/" 29 | } 30 | ) -Compress 31 | 32 | $settings = 33 | [PSCustomObject]@{ 34 | Path = "SOFTWARE\Policies\Google\Chrome" 35 | Value = $apps 36 | Name = "WebAppInstallForceList" 37 | } | group Path 38 | 39 | foreach($setting in $settings){ 40 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 41 | if ($null -eq $registry) { 42 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 43 | } 44 | $setting.Group | %{ 45 | $registry.SetValue($_.name, $_.value) 46 | } 47 | $registry.Dispose() 48 | } 49 | ``` 50 | -------------------------------------------------------------------------------- /Set Microsoft Edge Home, New Tab Page and Home Button/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Set Microsoft Edge Home, New Tab Page and Home Button 2 | 3 | Objectives: 4 | 5 | * Set Microsoft Edge Home, New Tab Page and Home Button 6 | 7 | Notes: Works for Windows Pro and Enterprise
8 | 9 | 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\Microsoft\Edge" 17 | Value = "https://duckduckgo.com" 18 | Name = "HomepageLocation" # set homepage 19 | }, 20 | [PSCustomObject]@{ 21 | Path = "SOFTWARE\Policies\Microsoft\Edge" 22 | Value = "https://google.com/" 23 | Name = "NewTabPageLocation" # set new page 24 | }, 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Policies\Microsoft\Edge" 27 | Value = 0 # 1 - Enable, 2 - Disable 28 | Name = "HomepageIsNewTabPage" # home page same as new page 29 | }, 30 | [PSCustomObject]@{ 31 | Path = "SOFTWARE\Policies\Microsoft\Edge" 32 | Value = 1 # 1 - Enable, 2 - Disable 33 | Name = "ShowHomeButton" # Show home button 34 | } | group Path 35 | 36 | foreach($setting in $settings){ 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 38 | if ($null -eq $registry) { 39 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 40 | } 41 | $setting.Group | %{ 42 | $registry.SetValue($_.name, $_.value) 43 | } 44 | $registry.Dispose() 45 | } 46 | ``` -------------------------------------------------------------------------------- /Set Brave Browser Home, New Tab Page and Home Button/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Set Brave Browser Home, New Tab Page and Home Button 2 | 3 | Objectives: 4 | 5 | * Set Brave Browser Home, New Tab Page and Home Button 6 | 7 | Notes: Works for Windows Pro and Enterprise
8 | 9 | 10 | 11 | PowerShell snippet: 12 | 13 | ```powershell 14 | $settings = 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 17 | Value = "https://google.com" 18 | Name = "HomepageLocation" # set homepage 19 | }, 20 | [PSCustomObject]@{ 21 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 22 | Value = "https://duckduckgo.com/" 23 | Name = "NewTabPageLocation" # set new page 24 | }, 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 27 | Value = 0 # 1 - Enable, 2 - Disable 28 | Name = "HomepageIsNewTabPage" # home page same as new page 29 | }, 30 | [PSCustomObject]@{ 31 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 32 | Value = 1 # 1 - Enable, 2 - Disable 33 | Name = "ShowHomeButton" # Show home button 34 | } | group Path 35 | 36 | foreach($setting in $settings){ 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 38 | if ($null -eq $registry) { 39 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 40 | } 41 | $setting.Group | %{ 42 | $registry.SetValue($_.name, $_.value) 43 | } 44 | $registry.Dispose() 45 | } 46 | ``` -------------------------------------------------------------------------------- /Set default Brave Browser search provider/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Change default Brave Browser search provider 2 | 3 | Objectives: 4 | 5 | * Change default Brave Browser search provider 6 | 7 | Notes: Works for Windows Pro and Enterprise
8 | 9 | 10 | 11 | Providers:
12 | 13 | * google: https://www.google.com/search?q={searchTerms} 14 | * duckduckgo: https://duckduckgo.com/?q={searchTerms} 15 | * bing: https://www.bing.com/search?q={searchTerms} 16 | * yahoo: https://search.yahoo.com/search?p={searchTerms} 17 | * yandex: https://yandex.com/search/?text={searchTerms} 18 | 19 | PowerShell snippet: 20 | 21 | ```powershell 22 | $settings = 23 | [PSCustomObject]@{ # Enable default search providers 24 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 25 | Value = 1 26 | Name = "DefaultSearchProviderEnabled" 27 | }, 28 | [PSCustomObject]@{ # Set search provider url 29 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 30 | Value = "https://duckduckgo.com/?q={searchTerms}" 31 | Name = "DefaultSearchProviderSearchURL" 32 | } | group Path 33 | 34 | foreach($setting in $settings){ 35 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 36 | if ($null -eq $registry) { 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 38 | } 39 | $setting.Group | %{ 40 | $registry.SetValue($_.name, $_.value) 41 | } 42 | $registry.Dispose() 43 | } 44 | ``` -------------------------------------------------------------------------------- /Google Chrome allow only certain pages/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Google Chrome allow only certain pages 2 | 3 | Documentation: 4 | 5 | * [Allow access to a list of URLs](https://chromeenterprise.google/policies/?policy=URLAllowlist) 6 | 7 | Objective: 8 | 9 | * Google Chrome allow only certain pages 10 | * Block everything 11 | * Allow google.com 12 | * Allow youtube.com 13 | * Allow duckduckgo.com 14 | 15 | PowerShell snippet: 16 | 17 | ```powershell 18 | $settings = 19 | [PSCustomObject]@{ # block everything 20 | Path = "SOFTWARE\Policies\Google\Chrome\URLBlocklist" 21 | Value = "*" 22 | Name = "1" 23 | }, 24 | [PSCustomObject]@{ # allow google.com 25 | Path = "SOFTWARE\Policies\Google\Chrome\URLAllowlist" 26 | Value = "google.com" 27 | Name = ++$count 28 | }, 29 | [PSCustomObject]@{ # allow google.com 30 | Path = "SOFTWARE\Policies\Google\Chrome\URLAllowlist" 31 | Value = "duckduckgo.com" 32 | Name = ++$count 33 | }, 34 | [PSCustomObject]@{ # allow youtube.com 35 | Path = "SOFTWARE\Policies\Google\Chrome\URLAllowlist" 36 | Value = "youtube.com" 37 | Name = ++$count 38 | } | group Path 39 | 40 | foreach($setting in $settings){ 41 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 42 | if ($null -eq $registry) { 43 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 44 | } 45 | $setting.Group | %{ 46 | $registry.SetValue($_.name, $_.value) 47 | } 48 | $registry.Dispose() 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Deploy Brave Browser bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Deploy Brave Browser bookmarks 2 | 3 | Objective: 4 | 5 | * Deploy Brave Browser bookmarks 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $managed_bookmarks = @{ 11 | toplevel_name = "Managed bookmarks" 12 | }, 13 | @{ 14 | name = "YouTube" 15 | url = "https://youtube.com" 16 | }, 17 | @{ 18 | children = 19 | @{ 20 | name = "DuckDuckGo" 21 | url = "https://duckduckgo.com" 22 | }, 23 | @{ 24 | name = "Bing" 25 | url = "https://bing.com" 26 | }, 27 | @{ 28 | name = "Google" 29 | url = "https://google.com" 30 | } 31 | name = "Search Engines" 32 | }, 33 | @{ 34 | children = 35 | @{ 36 | name = "Instagram" 37 | url = "https://instagram.com" 38 | }, 39 | @{ 40 | name = "Facebook" 41 | url = "https://facebook.com" 42 | } 43 | name = "Social media" 44 | } | ConvertTo-JSON -depth 4 -Compress 45 | 46 | $settings = 47 | [PSCustomObject]@{ 48 | Path = "SOFTWARE\Policies\BraveSoftware\Brave" 49 | Value = $managed_bookmarks 50 | Name = "ManagedBookmarks" 51 | } | group Path 52 | 53 | foreach($setting in $settings){ 54 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 55 | if ($null -eq $registry) { 56 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 57 | } 58 | $setting.Group | %{ 59 | $registry.SetValue($_.name, $_.value) 60 | } 61 | $registry.Dispose() 62 | } 63 | ``` 64 | -------------------------------------------------------------------------------- /Firefox deploy managed bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox deploy managed bookmarks 2 | 3 | Objective: 4 | 5 | * Firefox deploy managed bookmarks 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $managed_bookmarks = @{ 11 | toplevel_name = "Managed bookmarks" 12 | }, 13 | @{ 14 | name = "YouTube" 15 | url = "https://youtube.com" 16 | }, 17 | @{ 18 | children = 19 | @{ 20 | name = "DuckDuckGo" 21 | url = "https://duckduckgo.com" 22 | }, 23 | @{ 24 | name = "Bing" 25 | url = "https://bing.com" 26 | }, 27 | @{ 28 | name = "Google" 29 | url = "https://google.com" 30 | } 31 | name = "Search Engines" 32 | }, 33 | @{ 34 | children = 35 | @{ 36 | name = "Instagram" 37 | url = "https://instagram.com" 38 | }, 39 | @{ 40 | name = "Facebook" 41 | url = "https://facebook.com" 42 | } 43 | name = "Social media" 44 | } | ConvertTo-JSON -depth 4 -Compress 45 | 46 | $settings = 47 | [PSCustomObject]@{ 48 | Path = "SOFTWARE\Policies\Mozilla\Firefox" 49 | Value = $managed_bookmarks 50 | Name = "ManagedBookmarks" 51 | } | group Path 52 | 53 | foreach($setting in $settings){ 54 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 55 | if ($null -eq $registry) { 56 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 57 | } 58 | $setting.Group | %{ 59 | $registry.SetValue($_.name, $_.value) 60 | } 61 | $registry.Dispose() 62 | } 63 | ``` 64 | -------------------------------------------------------------------------------- /Firefox allow only certain web pages/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox allow only certain web pages 2 | 3 | Documentation: 4 | 5 | * [Match Patterns](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) 6 | 7 | Objective: 8 | 9 | * Firefox allow only certain web pages 10 | * Block everything 11 | * Allow google.com 12 | * Allow youtube.com 13 | * Allow duckduckgo.com 14 | 15 | PowerShell snippet: 16 | 17 | ```powershell 18 | $settings = 19 | [PSCustomObject]@{ # block everything 20 | Path = "SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Block" 21 | Value = "" 22 | Name = "1" 23 | }, 24 | [PSCustomObject]@{ # allow facebook 25 | Path = "SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Exceptions" 26 | Value = "*://*.google.com/*" 27 | Name = ++$count 28 | }, 29 | [PSCustomObject]@{ # allow instagram 30 | Path = "SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Exceptions" 31 | Value = "*://*.youtube.com/*" 32 | Name = ++$count 33 | }, 34 | [PSCustomObject]@{ # allow instagram 35 | Path = "SOFTWARE\Policies\Mozilla\Firefox\WebsiteFilter\Exceptions" 36 | Value = "*://*.duckduckgo.com/*" 37 | Name = ++$count 38 | } | group Path 39 | 40 | foreach($setting in $settings){ 41 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 42 | if ($null -eq $registry) { 43 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 44 | } 45 | $setting.Group | %{ 46 | $registry.SetValue($_.name, $_.value) 47 | } 48 | $registry.Dispose() 49 | } 50 | ``` 51 | -------------------------------------------------------------------------------- /Set Google Chrome as Default browser/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Set Google Chrome as Default browser 2 | 3 | Objectives: 4 | 5 | * Set Google Chrome as Default browser 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | [System.IO.FileInfo]$DefaultAssociationsConfiguration = "$($env:ProgramData)\provisioning\DefaultAssociationsConfiguration.xml" 11 | 12 | if(!$DefaultAssociationsConfiguration.Directory.Exists){ 13 | $DefaultAssociationsConfiguration.Directory.Create() 14 | } 15 | 16 | ' 17 | 18 | 19 | 20 | 21 | 22 | ' | Out-File $DefaultAssociationsConfiguration.FullName -Encoding utf8 -Force 23 | 24 | $settings = 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Policies\Microsoft\Windows\System" 27 | Value = $DefaultAssociationsConfiguration.FullName 28 | Name = "DefaultAssociationsConfiguration" 29 | } | group Path 30 | 31 | foreach($setting in $settings){ 32 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 33 | if ($null -eq $registry) { 34 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 35 | } 36 | $setting.Group | %{ 37 | $registry.SetValue($_.name, $_.value) 38 | } 39 | $registry.Dispose() 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /Windows 11 remove chat from taskbar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 remove chat from taskbar 2 | 3 | Objectives: 4 | 5 | * Remove copilot for current user 6 | * Remove copilot for all existing current users and new ones 7 | 8 | For single user: 9 | 10 | ```powershell 11 | $settings = [PSCustomObject]@{ 12 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 13 | Value = 0 14 | Name = "TaskbarMn" 15 | } | group Path 16 | 17 | foreach ($setting in $settings) { 18 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | % { 23 | if (!$_.Type) { 24 | $registry.SetValue($_.name, $_.value) 25 | } 26 | else { 27 | $registry.SetValue($_.name, $_.value, $_.type) 28 | } 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | 34 | For all existing and new users: 35 | 36 | ``` powershell 37 | ni "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\HideCopilot" | New-ItemProperty -Name "StubPath" -Value 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarMn /t REG_DWORD /d 0 /f' 38 | ``` 39 | 40 | ## Related videos 41 | 42 | Windows Registry 43 | 44 | [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw)
45 | [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) 46 | 47 | Other powershell videos 48 | 49 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Windows 11 remove copilot from taskbar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 remove copilot from taskbar 2 | 3 | Objectives: 4 | 5 | * Remove copilot for current user 6 | * Remove copilot for all existing current users and new ones 7 | 8 | For single user: 9 | 10 | ```powershell 11 | $settings = [PSCustomObject]@{ 12 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 13 | Value = 0 14 | Name = "ShowCopilotButton" 15 | } | group Path 16 | 17 | foreach ($setting in $settings) { 18 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | % { 23 | if (!$_.Type) { 24 | $registry.SetValue($_.name, $_.value) 25 | } 26 | else { 27 | $registry.SetValue($_.name, $_.value, $_.type) 28 | } 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | 34 | For all existing and new users: 35 | 36 | ``` powershell 37 | ni "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\HideCopilot" | New-ItemProperty -Name "StubPath" -Value 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowCopilotButton /t REG_DWORD /d 0 /f' 38 | ``` 39 | 40 | ## Related videos 41 | 42 | Windows Registry 43 | 44 | [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw)
45 | [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) 46 | 47 | Other powershell videos 48 | 49 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Get-WinHomeLocation, Set-WinHomeLocation/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-WinHomeLocation, Set-WinHomeLocation 2 | 3 | Documentation: 4 | 5 | [Get-WinHomeLocation](https://learn.microsoft.com/en-us/powershell/module/international/get-winhomelocation?view=windowsserver2022-ps)
6 | [Set-WinHomeLocation](https://learn.microsoft.com/en-us/powershell/module/international/set-winhomelocation?view=windowsserver2022-ps)
7 | [Copy-UserInternationalSettingsToSystem](https://learn.microsoft.com/en-us/powershell/module/international/copy-userinternationalsettingstosystem?view=windowsserver2022-ps)
8 | [Table of Geographical Locations](https://learn.microsoft.com/en-us/windows/win32/intl/table-of-geographical-locations?redirectedfrom=MSDN) 9 | 10 | Get current home location: 11 | 12 | ```powershell 13 | Get-WinHomeLocation 14 | ``` 15 | 16 | Set home location to: 17 | 18 | ```powershell 19 | Set-WinHomeLocation 84 20 | ``` 21 | 22 | Copy settings to new users and welcome screen: 23 | 24 | ```powershell 25 | Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True 26 | ``` 27 | 28 | ### Related videos 29 | 30 | Regional powershell commands: 31 | 32 | [Get-Culture, Set-Culture](https://youtu.be/gS4BckaTKto)
33 | [Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage](https://youtu.be/eN-56mOM5GQ)
34 | [Get-TimeZone, Set-TimeZone](https://youtu.be/fmoIfJwvH-I)
35 | [Get-WinSystemLocale, Set-WinSystemLocale](https://youtu.be/rCGlh3hp1fI)
36 | [Get-WinUserLanguageList, Set-WinUserLanguageList](https://youtu.be/Bhl-rLB8g28)
37 | 38 | Other powershell videos: 39 | 40 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Get-Culture, Set-Culture/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-Culture, Set-Culture 2 | 3 | Documentation: 4 | 5 | [Get-Culture](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-culture?view=powershell-5.1)
6 | [Set-Culture](https://learn.microsoft.com/en-us/powershell/module/international/set-culture?view=windowsserver2022-ps)
7 | [Copy-UserInternationalSettingsToSystem](https://learn.microsoft.com/en-us/powershell/module/international/copy-userinternationalsettingstosystem?view=windowsserver2022-ps)
8 | [Default input profiles (input locales) in Windows](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs?view=windows-11) 9 | 10 | Get-Culture: 11 | 12 | ```powershell 13 | Get-Culture 14 | ``` 15 | 16 | Use Set-Culture to set regional settings to French: 17 | 18 | ```powershell 19 | Set-Culture fr-FR 20 | ``` 21 | 22 | Copy settings to new users and welcome screen: 23 | 24 | ```powershell 25 | Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True 26 | ``` 27 | 28 | ### Related videos 29 | 30 | Regional powershell commands: 31 | 32 | [Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage](https://youtu.be/eN-56mOM5GQ)
33 | [Get-TimeZone, Set-TimeZone](https://youtu.be/fmoIfJwvH-I)
34 | [Get-WinHomeLocation, Set-WinHomeLocation](https://youtu.be/yWp_1L8YDoQ)
35 | [Get-WinSystemLocale, Set-WinSystemLocale](https://youtu.be/rCGlh3hp1fI)
36 | [Get-WinUserLanguageList, Set-WinUserLanguageList](https://youtu.be/Bhl-rLB8g28)
37 | 38 | Other powershell videos: 39 | 40 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 41 | -------------------------------------------------------------------------------- /Windows 11 remove search bar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 remove search bar 2 | 3 | Objectives: 4 | 5 | * Remove search bar for current user 6 | * Remove search bar for all existing current users and new ones 7 | 8 | For single user: 9 | 10 | ```powershell 11 | $settings = [PSCustomObject]@{ 12 | Path = "Software\Microsoft\Windows\CurrentVersion\Search" 13 | Value = 0 14 | Name = "SearchboxTaskbarMode" 15 | } | group Path 16 | 17 | foreach ($setting in $settings) { 18 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | % { 23 | if (!$_.Type) { 24 | $registry.SetValue($_.name, $_.value) 25 | } 26 | else { 27 | $registry.SetValue($_.name, $_.value, $_.type) 28 | } 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | 34 | For all existing and new users: 35 | 36 | ``` powershell 37 | ni "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\SearchboxTaskbarMode" | New-ItemProperty -Name "StubPath" -Value 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v SearchboxTaskbarMode /t REG_SZ /d "cmd /c REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f' 38 | ``` 39 | 40 | ## Related videos 41 | 42 | Windows Registry 43 | 44 | [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw)
45 | [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) 46 | 47 | Other powershell videos 48 | 49 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Get-TimeZone, Set-TimeZone/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-TimeZone, Set-TimeZone 2 | 3 | Documentation: 4 | 5 | [Get-TimeZone](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-timezone?view=powershell-5.1)
6 | [Set-TimeZone](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-timezone?view=powershell-5.1) 7 | 8 | 9 | Get currently set time zone: 10 | 11 | ```powershell 12 | Get-TimeZone 13 | ``` 14 | 15 | List availble time zones: 16 | 17 | ```powershell 18 | Get-TimeZone -ListAvailable 19 | ``` 20 | 21 | Get time zone by name: 22 | 23 | ```powershell 24 | Get-TimeZone "*utc*" 25 | ``` 26 | 27 | Get time zone by DisplayName: 28 | 29 | ```powershell 30 | Get-TimeZone -ListAvailable | ?{$_.DisplayName -like "*Paris*"} 31 | ``` 32 | 33 | Set time zone using Name parameter: 34 | 35 | ```powershell 36 | Set-TimeZone "FLE Standard Time" 37 | ``` 38 | 39 | Set time zone using DisplayName parameter: 40 | 41 | ```powershell 42 | Get-TimeZone -ListAvailable | ?{$_.DisplayName -like "*Paris*"} | Set-TimeZone 43 | ``` 44 | 45 | ### Related videos 46 | 47 | Regional powershell commands: 48 | 49 | [Get-Culture, Set-Culture](https://youtu.be/gS4BckaTKto)
50 | [Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage](https://youtu.be/eN-56mOM5GQ)
51 | [Get-WinHomeLocation, Set-WinHomeLocation](https://youtu.be/yWp_1L8YDoQ)
52 | [Get-WinSystemLocale, Set-WinSystemLocale](https://youtu.be/rCGlh3hp1fI)
53 | [Get-WinUserLanguageList, Set-WinUserLanguageList](https://youtu.be/Bhl-rLB8g28)
54 | 55 | Other powershell videos: 56 | 57 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Windows 11 move taskbar icons to left/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 move taskbar icons to left 2 | 3 | Objectives: 4 | 5 | * Move taskbar icons for current user 6 | * Move taskbar icons for all existing current users and new ones 7 | 8 | For single user: 9 | 10 | ```powershell 11 | $settings = [PSCustomObject]@{ 12 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 13 | Value = 0 14 | Name = "TaskbarAl" 15 | } | group Path 16 | 17 | foreach ($setting in $settings) { 18 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 19 | if ($null -eq $registry) { 20 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 21 | } 22 | $setting.Group | % { 23 | if (!$_.Type) { 24 | $registry.SetValue($_.name, $_.value) 25 | } 26 | else { 27 | $registry.SetValue($_.name, $_.value, $_.type) 28 | } 29 | } 30 | $registry.Dispose() 31 | } 32 | ``` 33 | 34 | For all existing and new users: 35 | 36 | ``` powershell 37 | ni "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\TaskbarAl" | New-ItemProperty -Name "StubPath" -Value 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v TaskbarAl /t REG_SZ /d "cmd /c REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f' 38 | ``` 39 | 40 | ## Related videos 41 | 42 | Windows Registry 43 | 44 | [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw)
45 | [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) 46 | 47 | Other powershell videos 48 | 49 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 50 | -------------------------------------------------------------------------------- /Windows 11 Configure regional settings/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 Configure regional settings 2 | 3 | Documentation: 4 | 5 | [Default input profiles (input locales) in Windows](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs?view=windows-11)
6 | [Table of Geographical Locations](https://learn.microsoft.com/en-us/windows/win32/intl/table-of-geographical-locations?redirectedfrom=MSDN) 7 | 8 | PowerShell snippet: 9 | 10 | ```powershell 11 | # configure time zone 12 | 13 | Get-TimeZone -ListAvailable | ?{$_.DisplayName -like "*Budapest*"} | Set-TimeZone 14 | 15 | # configure regional/locale/keyboard settings 16 | # Hungarian 17 | $region = "hu-HU" 18 | 19 | Set-Culture $region 20 | Set-WinSystemLocale $region 21 | Set-WinUserLanguageList $region, "en-us" -force -wa silentlycontinue 22 | Set-WinHomeLocation 109 23 | 24 | # copy regional settings to new user accounts and welcome screen 25 | 26 | Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True 27 | ``` 28 | 29 | ### Related videos 30 | 31 | Regional powershell commands: 32 | 33 | [Get-Culture, Set-Culture](https://youtu.be/gS4BckaTKto)
34 | [Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage](https://youtu.be/eN-56mOM5GQ)
35 | [Get-TimeZone, Set-TimeZone](https://youtu.be/fmoIfJwvH-I)
36 | [Get-WinHomeLocation, Set-WinHomeLocation](https://youtu.be/yWp_1L8YDoQ)
37 | [Get-WinSystemLocale, Set-WinSystemLocale](https://youtu.be/rCGlh3hp1fI)
38 | [Get-WinUserLanguageList, Set-WinUserLanguageList](https://youtu.be/Bhl-rLB8g28)
39 | 40 | Other powershell videos: 41 | 42 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Firefox disable quick links in Home page/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox disable quick links in Home page 2 | 3 | Objective: 4 | 5 | * Firefox disable quick links in Home page 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 13 | Value = 1 14 | Name = "Locked" 15 | }, 16 | [PSCustomObject]@{ 17 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 18 | Value = 1 19 | Name = "Search" 20 | }, 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 23 | Value = 0 24 | Name = "Highlights" 25 | }, 26 | [PSCustomObject]@{ 27 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 28 | Value = 0 29 | Name = "Pocket" 30 | }, 31 | [PSCustomObject]@{ 32 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 33 | Value = 0 34 | Name = "Snippets" 35 | }, 36 | [PSCustomObject]@{ 37 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 38 | Value = 0 39 | Name = "SponsoredPocket" 40 | }, 41 | [PSCustomObject]@{ 42 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 43 | Value = 0 44 | Name = "SponsoredTopSites" 45 | }, 46 | [PSCustomObject]@{ 47 | Path = "SOFTWARE\Policies\Mozilla\Firefox\FirefoxHome" 48 | Value = 0 49 | Name = "TopSites" 50 | } | group Path 51 | 52 | foreach($setting in $settings){ 53 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 54 | if ($null -eq $registry) { 55 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 56 | } 57 | $setting.Group | %{ 58 | $registry.SetValue($_.name, $_.value) 59 | } 60 | $registry.Dispose() 61 | } 62 | ``` 63 | -------------------------------------------------------------------------------- /Deploy Microsoft Edge favorites/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Deploy Microsoft Edge favorites 2 | 3 | Documentation: 4 | 5 | * [ManagedFavorites](https://learn.microsoft.com/en-us/DeployEdge/microsoft-edge-policies#managedfavorites) 6 | * [Provision favorites and folders](https://learn.microsoft.com/en-us/deployedge/edge-learnmore-provision-favorites#provision-favorites-and-folders) 7 | 8 | Objective: 9 | 10 | * Deploy Microsoft Edge favorites 11 | 12 | PowerShell snippet: 13 | 14 | ```powershell 15 | $managed_favorites = @{ 16 | toplevel_name = "Managed favorites" 17 | }, 18 | @{ 19 | name = "YouTube" 20 | url = "https://youtube.com" 21 | }, 22 | @{ 23 | children = 24 | @{ 25 | name = "DuckDuckGo" 26 | url = "https://duckduckgo.com" 27 | }, 28 | @{ 29 | name = "Bing" 30 | url = "https://bing.com" 31 | }, 32 | @{ 33 | name = "Google" 34 | url = "https://google.com" 35 | } 36 | name = "Search Engines" 37 | }, 38 | @{ 39 | children = 40 | @{ 41 | name = "Instagram" 42 | url = "https://instagram.com" 43 | }, 44 | @{ 45 | name = "Facebook" 46 | url = "https://facebook.com" 47 | } 48 | name = "Social media" 49 | } | ConvertTo-JSON -depth 4 -Compress 50 | 51 | $settings = 52 | [PSCustomObject]@{ 53 | Path = "SOFTWARE\Policies\Microsoft\Edge" 54 | Value = $managed_favorites 55 | Name = "ManagedFavorites" 56 | } | group Path 57 | 58 | foreach($setting in $settings){ 59 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 60 | if ($null -eq $registry) { 61 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 62 | } 63 | $setting.Group | %{ 64 | $registry.SetValue($_.name, $_.value) 65 | } 66 | $registry.Dispose() 67 | } 68 | ``` 69 | -------------------------------------------------------------------------------- /Creating viewer requested script 03/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Creating viewer requested script 03 2 | 3 | Request: 4 | 5 | 6 | 7 | Snippet for modifying Windows performance settings: 8 | 9 | ```powershell 10 | [IO.DirectoryInfo]$provisioning = "$($env:PROGRAMDATA)\provisioning" 11 | 12 | if(!$provisioning.Exists){ 13 | $provisioning.Create() 14 | } 15 | 16 | @" 17 | Windows Registry Editor Version 5.00 18 | 19 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects] 20 | "VisualFXSetting"=dword:00000003 21 | 22 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] 23 | "IconsOnly"=dword:00000001 24 | "ListviewAlphaSelect"=dword:00000000 25 | "ListviewShadow"=dword:00000000 26 | "TaskbarAnimations"=dword:00000000 27 | 28 | [HKEY_CURRENT_USER\Control Panel\Desktop] 29 | "UserPreferencesMask"=hex:98,32,07,80,10,00,00,00 30 | "DragFullWindows"="0" 31 | 32 | [HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics] 33 | "MinAnimate"="0" 34 | 35 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM] 36 | "EnableAeroPeek"=dword:00000000 37 | 38 | "@ | Out-File "$($provisioning.FullName)\user-settings.reg" -Encoding unicode -Force 39 | 40 | $configure_active_setup = @{ 41 | Path = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\UserSettings" 42 | ErrorAction = "SilentlyContinue" 43 | } 44 | 45 | $configure_runonce = @{ 46 | Name = "StubPath" 47 | Value = 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ImportUserRegistry /d "REG IMPORT {0}" /f' -f "$($provisioning.FullName)\user-settings.reg" 48 | } 49 | 50 | ni @configure_active_setup | New-ItemProperty @configure_runonce 51 | ``` 52 | 53 | ## Related videos 54 | 55 | Other powershell videos: 56 | 57 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 58 | * [Windows Registry](https://www.youtube.com/playlist?list=PLVncjTDMNQ4TZrwwuYuZBZhpjs6YWw7sQ) -------------------------------------------------------------------------------- /Remove Home and Gallery from File Explorer/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Remove Home and Gallery from File Explorer 2 | 3 | Objectives: 4 | 5 | * Remove Home and Gallery from File Explorer 6 | 7 | # Updated 2024-06-14 for Windows 11 23h2 8 | 9 | ```powershell 10 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}", 11 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}", 12 | "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}", 13 | "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}" | %{ 14 | ri $_ -force 15 | } 16 | ``` 17 | 18 | # Before 2024-06-14 update for Windows 11 23h2 19 | 20 | Remove home and gallery: 21 | 22 | ```powershell 23 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_41040327\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}", 24 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_36354489\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}" | %{ 25 | ri $_ -force 26 | } 27 | ``` 28 | 29 | CMD remove gallery: 30 | 31 | ```batch 32 | reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_41040327\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c} /f 33 | ``` 34 | 35 | CMD add gallery: 36 | 37 | ```batch 38 | reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_41040327\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c} /d {e88865ea-0e1c-4e20-9aa6-edcd0212c87c} 39 | ``` 40 | 41 | CMD remove home: 42 | 43 | ```batch 44 | reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_36354489\{f874310e-b6b7-47dc-bc84-b9e6b38f5903} /f 45 | ``` 46 | 47 | CMD add home: 48 | 49 | ```batch 50 | reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_36354489\{f874310e-b6b7-47dc-bc84-b9e6b38f5903} /d CLSID_MSGraphHomeFolder 51 | ``` -------------------------------------------------------------------------------- /Windows 11 remove Learn about this picture/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 remove Learn about this picture 2 | 3 | Remove "Learn about this picture" for single user: 4 | 5 | ```powershell 6 | New-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{2cc5ca98-6485-489a-920e-b3e88a6ccce3}" -value 1 -ea SilentlyContinue 7 | ``` 8 | 9 | Remove "Learn about this picture" for all users: 10 | 11 | ```powershell 12 | [System.IO.DirectoryInfo]$provisioning = "$($env:ProgramData)\provisioning" 13 | 14 | if (!$provisioning.Exists) { 15 | $provisioning.Create() 16 | } 17 | 18 | @" 19 | Windows Registry Editor Version 5.00 20 | 21 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel] 22 | "{2cc5ca98-6485-489a-920e-b3e88a6ccce3}"=dword:00000001 23 | "@ | Out-File "$($provisioning.FullName)\RemoveLearnAboutPicture.reg" -Encoding unicode 24 | 25 | $registry_settings = 26 | [PSCustomObject]@{ # Import RemoveLearnAboutPicture using ActiveSetup 27 | Path = "SOFTWARE\Microsoft\Active Setup\Installed Components\ImportUserRegistry" 28 | Name = "StubPath" 29 | Value = 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ImportUserRegistry /d "REG IMPORT {0}" /f' -f "$($provisioning.FullName)\RemoveLearnAboutPicture.reg" 30 | } 31 | 32 | foreach ($setting in ($registry_settings | group Path)) { 33 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 34 | if ($null -eq $registry) { 35 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 36 | } 37 | $setting.Group | % { 38 | if (!$_.Type) { 39 | $registry.SetValue($_.name, $_.value) 40 | } 41 | else { 42 | $registry.SetValue($_.name, $_.value, $_.type) 43 | } 44 | } 45 | $registry.Dispose() 46 | } 47 | ``` 48 | 49 | # Related videos 50 | 51 | PowerShell: 52 | 53 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 54 | 55 | Reigstry: 56 | 57 | * [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) 58 | * [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw) -------------------------------------------------------------------------------- /Get-WinUserLanguageList, Set-WinUserLanguageList/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-WinUserLanguageList, Set-WinUserLanguageList 2 | 3 | Documentation: 4 | 5 | [Get-WinUserLanguageList](https://learn.microsoft.com/en-us/powershell/module/international/get-winuserlanguagelist?view=windowsserver2022-ps)
6 | [Set-WinUserLanguageList](https://learn.microsoft.com/en-us/powershell/module/international/set-winuserlanguagelist?view=windowsserver2022-ps)
7 | [Copy-UserInternationalSettingsToSystem](https://learn.microsoft.com/en-us/powershell/module/international/copy-userinternationalsettingstosystem?view=windowsserver2022-ps)
8 | [Default input profiles (input locales) in Windows](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-input-locales-for-windows-language-packs?view=windows-11) 9 | 10 | Get-WinUserLanguageList: 11 | 12 | ```powershell 13 | Get-WinUserLanguageList 14 | ``` 15 | 16 | Use Set-WinUserLanguageList to set fr-fr keyboard: 17 | 18 | ```powershell 19 | Set-WinUserLanguageList fr-fr -force -wa silentlycontinue 20 | ``` 21 | 22 | Use Set-WinUserLanguageList to set multiple keyboards: 23 | 24 | ```powershell 25 | Set-WinUserLanguageList en-us, fr-fr -force -wa silentlycontinue 26 | ``` 27 | 28 | Add keyboard to current keyboard list: 29 | 30 | ```powershell 31 | $keyboards = Get-WinUserLanguageList 32 | $keyboards.add('hu-HU') 33 | Set-WinUserLanguageList $keyboards -force -wa silentlycontinue 34 | ``` 35 | 36 | Copy settings to new users and welcome screen: 37 | 38 | ```powershell 39 | Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True 40 | ``` 41 | 42 | ### Related videos 43 | 44 | Regional powershell commands: 45 | 46 | [Get-Culture, Set-Culture](https://youtu.be/gS4BckaTKto)
47 | [Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage](https://youtu.be/eN-56mOM5GQ)
48 | [Get-TimeZone, Set-TimeZone](https://youtu.be/fmoIfJwvH-I)
49 | [Get-WinHomeLocation, Set-WinHomeLocation](https://youtu.be/yWp_1L8YDoQ)
50 | [Get-WinSystemLocale, Set-WinSystemLocale](https://youtu.be/rCGlh3hp1fI)
51 | 52 | Other powershell videos: 53 | 54 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-InstalledLanguage, Install-Language, Get and Set-SystemPreferredUILanguage 2 | 3 | Documentation: 4 | 5 | * [Install-Language](https://learn.microsoft.com/en-us/powershell/module/languagepackmanagement/install-language?view=windowsserver2022-ps) 6 | * [Get-InstalledLanguage](https://learn.microsoft.com/en-us/powershell/module/languagepackmanagement/get-installedlanguage?view=windowsserver2022-ps) 7 | * [Set-SystemPreferredUILanguage](https://learn.microsoft.com/en-us/powershell/module/languagepackmanagement/set-systempreferreduilanguage?view=windowsserver2022-ps) 8 | 9 | Use powershell to: 10 | 11 | * Check installed languages 12 | * Install French language 13 | 14 | List installed languages: 15 | 16 | ```powershell 17 | Get-InstalledLanguage 18 | ``` 19 | 20 | Show System Preferred UI language: 21 | 22 | ```powershell 23 | Get-SystemPreferredUILanguage 24 | ``` 25 | 26 | Install language: 27 | 28 | ```powershell 29 | $install_language = @{ 30 | Language = "fr-FR" 31 | CopyToSettings = $true # This parameter changes French language as default language for all users 32 | } 33 | Install-Language @install_language 34 | ``` 35 | 36 | # Install language if needed 37 | ```powershell 38 | $language = "fr-FR" 39 | 40 | $current_preferred_ui_lanague = Get-SystemPreferredUILanguage 41 | 42 | if($language -ne $current_preferred_ui_lanague){ 43 | $language_installed = Get-InstalledLanguage $language 44 | if(!$language_installed){ 45 | $install_language = @{ 46 | Language = $language 47 | } 48 | Install-Language @install_language 49 | } 50 | Set-SystemPreferredUILanguage $language 51 | } 52 | ``` 53 | 54 | ### Related videos 55 | 56 | Regional powershell commands: 57 | 58 | [Get-Culture, Set-Culture](https://youtu.be/gS4BckaTKto)
59 | [Get-TimeZone, Set-TimeZone](https://youtu.be/fmoIfJwvH-I)
60 | [Get-WinHomeLocation, Set-WinHomeLocation](https://youtu.be/yWp_1L8YDoQ)
61 | [Get-WinSystemLocale, Set-WinSystemLocale](https://youtu.be/rCGlh3hp1fI)
62 | [Get-WinUserLanguageList, Set-WinUserLanguageList](https://youtu.be/Bhl-rLB8g28)
63 | 64 | Other powershell videos: 65 | 66 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Creating viewer requested script 01/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Creating viewer requested script 01 2 | 3 | Request: 4 | 5 | 6 | 7 | Actions performed by powershell script: 8 | 9 | * Get current registry entry value for "Automatically hide taskbar" 10 | * Modify the bit that is responsible for "Automatically hide taskbar" 11 | * Create provisioning folder in C:\ProgramData\ directory 12 | * Create user-settings.reg registry file with taskbar configuration in C:\ProgramData\provisioning directory 13 | * Configure ActiveSetup to import user-settings.reg file for users that will sign-in to the computer 14 | 15 | Snippet for modifying taskbar settings: 16 | 17 | ```powershell 18 | $get_stuck_rects3_settings = @{ 19 | Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" 20 | Name = "Settings" 21 | } 22 | 23 | $stuck_rects3 = Get-ItemProperty @get_stuck_rects3_settings 24 | 25 | $stuck_rects3.settings[8] = 2 26 | 27 | [IO.DirectoryInfo]$provisioning = "$($env:PROGRAMDATA)\provisioning" 28 | 29 | if(!$provisioning.Exists){ 30 | $provisioning.Create() 31 | } 32 | 33 | @" 34 | Windows Registry Editor Version 5.00 35 | 36 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] 37 | "TaskbarAl"=dword:00000000 38 | "TaskbarGlomLevel"=dword:00000002 39 | "TaskbarBadges"=dword:00000000 40 | "TaskbarFlashing"=dword:00000000 41 | "TaskbarSn"=dword:00000000 42 | "TaskbarSd"=dword:00000000 43 | 44 | [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3] 45 | "Settings"=hex:{0} 46 | 47 | "@ -f (($stuck_rects3.settings | %{'{0:X2}' -f $_ }) -join ',') | Out-File "$($provisioning.FullName)\user-settings.reg" -Encoding unicode -Force 48 | 49 | $configure_active_setup = @{ 50 | Path = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\UserSettings" 51 | ErrorAction = "SilentlyContinue" 52 | } 53 | 54 | $configure_runonce = @{ 55 | Name = "StubPath" 56 | Value = 'REG IMPORT "{0}"' -f "$($provisioning.FullName)\user-settings.reg" 57 | } 58 | 59 | ni @configure_active_setup | New-ItemProperty @configure_runonce 60 | ``` 61 | 62 | ## Related videos 63 | 64 | Other powershell videos: 65 | 66 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 67 | * [Windows Registry](https://www.youtube.com/playlist?list=PLVncjTDMNQ4TZrwwuYuZBZhpjs6YWw7sQ) -------------------------------------------------------------------------------- /Deploy Google Chrome bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Deploy Google Chrome bookmarks 2 | 3 | Objective: 4 | 5 | * Deploy Google Chrome bookmarks 6 | 7 | PowerShell snippet: 8 | 9 | ```powershell 10 | $managed_bookmarks = @{ 11 | toplevel_name = "Managed bookmarks" 12 | }, 13 | @{ 14 | name = "YouTube" 15 | url = "https://youtube.com" 16 | }, 17 | @{ 18 | children = 19 | @{ 20 | name = "DuckDuckGo" 21 | url = "https://duckduckgo.com" 22 | }, 23 | @{ 24 | name = "Bing" 25 | url = "https://bing.com" 26 | }, 27 | @{ 28 | name = "Google" 29 | url = "https://google.com" 30 | } 31 | name = "Search Engines" 32 | }, 33 | @{ 34 | children = 35 | @{ 36 | name = "Instagram" 37 | url = "https://instagram.com" 38 | }, 39 | @{ 40 | name = "Facebook" 41 | url = "https://facebook.com" 42 | } 43 | name = "Social media" 44 | } | ConvertTo-JSON -depth 4 -Compress 45 | 46 | $settings = 47 | [PSCustomObject]@{ 48 | Path = "SOFTWARE\Policies\Google\Chrome" 49 | Value = $managed_bookmarks 50 | Name = "ManagedBookmarks" 51 | } | group Path 52 | 53 | foreach($setting in $settings){ 54 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 55 | if ($null -eq $registry) { 56 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 57 | } 58 | $setting.Group | %{ 59 | $registry.SetValue($_.name, $_.value) 60 | } 61 | $registry.Dispose() 62 | } 63 | ``` 64 | 65 | Example without child nodes: 66 | 67 | ```powershell 68 | $managed_bookmarks = @{ 69 | toplevel_name = "Managed bookmarks" 70 | }, 71 | @{ 72 | name = "YouTube" 73 | url = "https://youtube.com" 74 | }, 75 | @{ 76 | name = "Instagram" 77 | url = "https://instagram.com" 78 | } | ConvertTo-JSON -depth 4 -Compress 79 | 80 | $settings = 81 | [PSCustomObject]@{ 82 | Path = "SOFTWARE\Policies\Google\Chrome" 83 | Value = $managed_bookmarks 84 | Name = "ManagedBookmarks" 85 | } | group Path 86 | 87 | foreach($setting in $settings){ 88 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 89 | if ($null -eq $registry) { 90 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 91 | } 92 | $setting.Group | %{ 93 | $registry.SetValue($_.name, $_.value) 94 | } 95 | $registry.Dispose() 96 | } 97 | ``` -------------------------------------------------------------------------------- /Configure Microsoft Edge KIOSK/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Configure Microsoft Edge KIOSK 2 | 3 | Documentation: 4 | 5 | * [AssignedAccess (Windows Configuration Designer reference)](https://learn.microsoft.com/en-us/windows/configuration/wcd/wcd-assignedaccess#assignedaccesssettings) 6 | * [Create an Assigned Access configuration XML file](https://learn.microsoft.com/en-us/windows/configuration/assigned-access/configuration-file?pivots=windows-11) 7 | * [Configure Microsoft Edge kiosk mode](https://learn.microsoft.com/en-us/deployedge/microsoft-edge-configure-kiosk-mode) 8 | * [Configure a restricted user experience (multi-app kiosk) with Assigned Access](https://learn.microsoft.com/en-us/windows/configuration/assigned-access/configure-multi-app-kiosk?tabs=ppkg) 9 | 10 | Downloads: 11 | 12 | * [PsExec](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec) 13 | 14 | Run PowerShell under SYSTEM user: 15 | 16 | ```batch 17 | PsExec.exe -i -s powershell 18 | ``` 19 | 20 | Apply KIOSK configuration: 21 | 22 | ```powershell 23 | $kiosk_configuration = 24 | @" 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | "@ 40 | 41 | # Configure KIOSK mode 42 | $get_cim_instance = @{ 43 | Namespace = "root\cimv2\mdm\dmmap" 44 | ClassName = "MDM_AssignedAccess" 45 | } 46 | $cim_instance = Get-CimInstance @get_cim_instance 47 | $cim_instance.Configuration = [System.Net.WebUtility]::HtmlEncode($kiosk_configuration) 48 | Set-CimInstance -CimInstance $cim_instance 49 | ``` 50 | 51 | Remove KIOSK configuration: 52 | 53 | ```powershell 54 | $get_cim_instance = @{ 55 | Namespace = "root\cimv2\mdm\dmmap" 56 | ClassName = "MDM_AssignedAccess" 57 | } 58 | 59 | $cim_instance = Get-CimInstance @get_cim_instance 60 | $cim_instance.Configuration = $null 61 | Set-CimInstance -CimInstance $cim_instance 62 | ``` -------------------------------------------------------------------------------- /Pin folder to File Explorers side bar/README.md: -------------------------------------------------------------------------------- 1 | ```powershell 2 | # MODIFY 3 | $quick_access_name = "Tools 3" 4 | $path = "%USERPROFILE%\Desktop\Tools 3" 5 | $icon = "%systemroot%\system32\shell32.dll,25" 6 | 7 | # DO NOT MODIFY 8 | $guid = [guid]::NewGuid().guid 9 | 10 | $settings = 11 | [PSCustomObject]@{ 12 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}" 13 | Value = $quick_access_name 14 | }, 15 | [PSCustomObject]@{ 16 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}" 17 | Name = "System.IsPinnedToNamespaceTree" 18 | Value = 1 19 | }, 20 | [PSCustomObject]@{ 21 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}" 22 | Name = "SortOrderIndex" 23 | Value = 66 24 | }, 25 | [PSCustomObject]@{ 26 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}\ShellFolder" 27 | Name = "FolderValueFlags" 28 | Value = 40 29 | }, 30 | [PSCustomObject]@{ 31 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 32 | Name = "{$($guid)}" 33 | Value = 1 34 | }, 35 | [PSCustomObject]@{ 36 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{$($guid)}" 37 | Value = $quick_access_name 38 | }, 39 | [PSCustomObject]@{ 40 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}\DefaultIcon" 41 | Value = $icon 42 | }, 43 | [PSCustomObject]@{ 44 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}\Instance" 45 | Name = "CLSID" 46 | Value = "{0E5AAE11-A475-4c5b-AB00-C66DE400274E}" 47 | }, 48 | [PSCustomObject]@{ 49 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}\InProcServer32" 50 | Value = "%systemroot%\system32\shell32.dll" 51 | Type = [Microsoft.Win32.RegistryValueKind]::ExpandString 52 | }, 53 | [PSCustomObject]@{ 54 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}\Instance\InitPropertyBag" 55 | Name = "TargetFolderPath" 56 | Value = $path 57 | Type = [Microsoft.Win32.RegistryValueKind]::ExpandString 58 | }, 59 | [PSCustomObject]@{ 60 | Path = "SOFTWARE\Classes\CLSID\{$($guid)}\Instance\InitPropertyBag" 61 | Name = "Attributes" 62 | Value = 17 63 | } | group Path 64 | 65 | 66 | foreach($setting in $settings){ 67 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 68 | if ($null -eq $registry) { 69 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 70 | } 71 | $setting.Group | %{ 72 | if(!$_.Type){ 73 | $registry.SetValue($_.name, $_.value) 74 | } 75 | else{ 76 | $registry.SetValue($_.name, $_.value, $_.type) 77 | } 78 | } 79 | $registry.Dispose() 80 | } 81 | 82 | Set-ItemProperty -Path "HKCU:\SOFTWARE\Classes\CLSID\{$($guid)}\ShellFolder" -Name "Attributes" -Value 4034920525 -type "DWord" 83 | ``` -------------------------------------------------------------------------------- /Stop Teams from running on startup in Windows 11/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Stop Teams from running on startup in Windows 11 2 | 3 | Request: 4 | 5 | 6 | 7 | Notes: 8 | 9 | * Works for Microsoft Teams(new) 10 | * Works only for users that have autorun enabled during script execution 11 | 12 | Registry entry location: 13 | 14 | ```batch 15 | HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams_8wekyb3d8bbwe\TeamsTfwStartupTask 16 | ``` 17 | 18 | Disable startup for single user: 19 | 20 | ```powershell 21 | Get-ItemProperty "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams*\TeamsTfwStartupTask" | Set-ItemProperty -Name state -Value 1 22 | ``` 23 | 24 | Disable startup for multiple user: 25 | 26 | ```powershell 27 | [System.IO.DirectoryInfo]$provisioning = "$($env:ProgramData)\provisioning" 28 | 29 | if (!$provisioning.Exists) { 30 | $provisioning.Create() 31 | } 32 | 33 | @" 34 | Windows Registry Editor Version 5.00 35 | 36 | [HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams_8wekyb3d8bbwe\TeamsTfwStartupTask] 37 | "State"=dword:00000001 38 | "@ | Out-File "$($provisioning.FullName)\DisableTeamsAutoStart.reg" -Encoding unicode 39 | 40 | $registry_settings = 41 | [PSCustomObject]@{ # Import DisableTeamsAutoStart using ActiveSetup 42 | Path = "SOFTWARE\Microsoft\Active Setup\Installed Components\ImportUserRegistry" 43 | Name = "StubPath" 44 | Value = 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ImportUserRegistry /d "REG IMPORT {0}" /f' -f "$($provisioning.FullName)\DisableTeamsAutoStart.reg" 45 | } 46 | 47 | foreach ($setting in ($registry_settings | group Path)) { 48 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 49 | if ($null -eq $registry) { 50 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 51 | } 52 | $setting.Group | % { 53 | if (!$_.Type) { 54 | $registry.SetValue($_.name, $_.value) 55 | } 56 | else { 57 | $registry.SetValue($_.name, $_.value, $_.type) 58 | } 59 | } 60 | $registry.Dispose() 61 | } 62 | ``` 63 | 64 | # Related videos 65 | 66 | PowerShell: 67 | 68 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 69 | 70 | Reigstry: 71 | 72 | * [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) 73 | * [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw) -------------------------------------------------------------------------------- /Windows 11 configure Start layout more pins/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 configure Start layout more pins 2 | 3 | Objectives: 4 | 5 | 6 | 7 | * Configure for current user 8 | * Configure for all users 9 | 10 | Set more pins for current user: 11 | 12 | ```powershell 13 | $settings = 14 | [PSCustomObject]@{ # Start menu layoyt more pins 15 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 16 | Name = "Start_Layout" 17 | Value = 1 # 0 - Default, 1 - More pins, 2 - More recommendations 18 | } 19 | 20 | foreach ($setting in ($settings | group Path)) { 21 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 22 | if ($null -eq $registry) { 23 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 24 | } 25 | $setting.Group | % { 26 | if (!$_.Type) { 27 | $registry.SetValue($_.name, $_.value) 28 | } 29 | else { 30 | $registry.SetValue($_.name, $_.value, $_.type) 31 | } 32 | } 33 | $registry.Dispose() 34 | } 35 | ``` 36 | 37 | Set more pins for all users: 38 | 39 | ```powershell 40 | [System.IO.DirectoryInfo]$provisioning = "$($env:ProgramData)\provisioning" 41 | 42 | if(!$provisioning.Exists){ 43 | $provisioning.Create() 44 | } 45 | 46 | @" 47 | Windows Registry Editor Version 5.00 48 | 49 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced] 50 | "Start_Layout"=dword:00000001 51 | "@ | Out-File "$($provisioning.FullName)\user_settings_registry.reg" -Encoding unicode -Force 52 | 53 | $settings = 54 | [PSCustomObject]@{ # Configure ActiveSetup to import registry file 55 | Path = "SOFTWARE\Microsoft\Active Setup\Installed Components\ImportUserRegistry" 56 | Name = "StubPath" 57 | Value = 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ImportUserRegistry /d "REG IMPORT {0}" /f' -f "$($provisioning.FullName)\user_settings_registry.reg" 58 | } 59 | 60 | foreach ($setting in ($settings | group Path)) { 61 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 62 | if ($null -eq $registry) { 63 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 64 | } 65 | $setting.Group | % { 66 | if (!$_.Type) { 67 | $registry.SetValue($_.name, $_.value) 68 | } 69 | else { 70 | $registry.SetValue($_.name, $_.value, $_.type) 71 | } 72 | } 73 | $registry.Dispose() 74 | } 75 | ``` 76 | 77 | # More PowerShell snippet videos: 78 | 79 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Microsoft Edge force install Progressive Web Apps (PWA)/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Microsoft Edge force install Progressive Web Apps (PWA) 2 | 3 | Objective: 4 | 5 | * Microsoft Edge force install Progressive Web Apps (PWA) 6 | * Install Twitter 7 | * Install Telegram 8 | * Install Spotify 9 | 10 | PowerShell snippet: 11 | 12 | ```powershell 13 | $apps = 14 | ConvertTo-Json @( 15 | @{ 16 | create_desktop_shortcut = $true 17 | default_launch_container = "window" 18 | url = "https://twitter.com/" 19 | }, 20 | @{ 21 | create_desktop_shortcut = $true 22 | default_launch_container = "window" 23 | url = "https://web.telegram.org/" 24 | }, 25 | @{ 26 | create_desktop_shortcut = $true 27 | default_launch_container = "window" 28 | url = "https://open.spotify.com/" 29 | } 30 | ) -Compress 31 | 32 | $settings = 33 | [PSCustomObject]@{ 34 | Path = "SOFTWARE\Policies\Microsoft\Edge" 35 | Value = $apps 36 | Name = "WebAppInstallForceList" 37 | } | group Path 38 | 39 | foreach($setting in $settings){ 40 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 41 | if ($null -eq $registry) { 42 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 43 | } 44 | $setting.Group | %{ 45 | $registry.SetValue($_.name, $_.value) 46 | } 47 | $registry.Dispose() 48 | } 49 | ``` 50 | 51 | PowerShell snippet with custom names for desktop items: 52 | 53 | ```powershell 54 | $apps = 55 | ConvertTo-Json @( 56 | @{ 57 | create_desktop_shortcut = $true 58 | default_launch_container = "window" 59 | url = "https://twitter.com/" 60 | custom_name = "X Not Twitter" 61 | }, 62 | @{ 63 | create_desktop_shortcut = $true 64 | default_launch_container = "window" 65 | url = "https://web.telegram.org/" 66 | custom_name = "Telegram" 67 | }, 68 | @{ 69 | create_desktop_shortcut = $true 70 | default_launch_container = "window" 71 | url = "https://open.spotify.com/" 72 | custom_name = "Spotify" 73 | } 74 | ) -Compress 75 | 76 | $settings = 77 | [PSCustomObject]@{ 78 | Path = "SOFTWARE\Policies\Microsoft\Edge" 79 | Value = $apps 80 | Name = "WebAppInstallForceList" 81 | } | group Path 82 | 83 | foreach($setting in $settings){ 84 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 85 | if ($null -eq $registry) { 86 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 87 | } 88 | $setting.Group | %{ 89 | $registry.SetValue($_.name, $_.value) 90 | } 91 | $registry.Dispose() 92 | } 93 | ``` -------------------------------------------------------------------------------- /Configure Windows auto logon registry settings/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Configure Windows auto logon registry settings 2 | 3 | Documentation: 4 | 5 | * [Turn on automatic logon in Windows](https://learn.microsoft.com/en-us/troubleshoot/windows-server/user-profiles-and-logon/turn-on-automatic-logon) 6 | * [Working with registry entries](https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-entries?view=powershell-5.1) 7 | 8 | Objectives: 9 | 10 | * Configure auto logon for local user 11 | * Configure auto logon for domain user 12 | * Remove auto logon registry settings 13 | 14 | Notes: 15 | 16 | * Auto logon user requires password 17 | * Auto logon stores password as plain text in registry 18 | 19 | Configure auto logon using powershell for local user: 20 | 21 | ```powershell 22 | $auto_logon_settings = 23 | [PSCustomObject]@{ # Enable auto logon 24 | Name = "AutoAdminLogon" 25 | Value = "1" 26 | }, 27 | [PSCustomObject]@{ # Configure username 28 | Name = "DefaultUserName" 29 | Value = "admin" 30 | }, 31 | [PSCustomObject]@{ # Configure password 32 | Name = "DefaultPassword" 33 | Value = "password55" 34 | } 35 | 36 | foreach ($item in $auto_logon_settings) { 37 | $item_property = @{ 38 | Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' 39 | Name = $item.name 40 | Value = $item.value 41 | } 42 | New-ItemProperty @item_property -Force | Out-Null 43 | } 44 | ``` 45 | 46 | Configure autologon using powershell for domain user: 47 | 48 | ```powershell 49 | $auto_logon_settings = 50 | [PSCustomObject]@{ # Enable auto logon 51 | Name = "AutoAdminLogon" 52 | Value = "1" 53 | }, 54 | [PSCustomObject]@{ # Configure username 55 | Name = "DefaultUserName" 56 | Value = "john" 57 | }, 58 | [PSCustomObject]@{ # Configure password 59 | Name = "DefaultPassword" 60 | Value = "password55#" 61 | }, 62 | [PSCustomObject]@{ # Configure domain 63 | Name = "DefaultDomainName" 64 | Value = "ad.letsdoautomation.com" 65 | } 66 | 67 | foreach ($item in $auto_logon_settings) { 68 | $item_property = @{ 69 | Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' 70 | Name = $item.name 71 | Value = $item.value 72 | } 73 | New-ItemProperty @item_property -Force | Out-Null 74 | } 75 | ``` 76 | 77 | Remove auto logon configuration in registry: 78 | 79 | ```powershell 80 | $auto_logon_settings = 81 | [PSCustomObject]@{ # Disable auto logon 82 | Name = "AutoAdminLogon" 83 | Value = "0" 84 | }, 85 | [PSCustomObject]@{ # Configure username 86 | Name = "DefaultUserName" 87 | Value = "" 88 | }, 89 | [PSCustomObject]@{ # Configure domain 90 | Name = "DefaultDomainName" 91 | Value = "" 92 | } 93 | 94 | foreach ($item in $auto_logon_settings) { 95 | $item_property = @{ 96 | Path = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' 97 | Name = $item.name 98 | Value = $item.value 99 | } 100 | New-ItemProperty @item_property -Force | Out-Null 101 | } 102 | 103 | Remove-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name "DefaultPassword" -ea SilentlyContinue 104 | ``` 105 | 106 | ## Related videos 107 | 108 | Other powershell videos 109 | 110 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 111 | -------------------------------------------------------------------------------- /Windows 11 configure wallpaper/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 configure wallpaper 2 | 3 | Objectives: 4 | 5 | * Configure wallpaper for single user 6 | * Configure wallpaper for all users 7 | * Method that allows wallpaper to changed 8 | * Method that doesn't allow wallpaper to changed 9 | 10 | Configure wallpaper for single user: 11 | 12 | ```powershell 13 | $settings = 14 | [PSCustomObject]@{ 15 | Path = "Control Panel\Desktop" 16 | Name = "WallPaper" 17 | Value = "C:\wallpaper.png" 18 | } 19 | 20 | foreach ($setting in ($settings | group Path)) { 21 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 22 | if ($null -eq $registry) { 23 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 24 | } 25 | $setting.Group | % { 26 | $registry.SetValue($_.name, $_.value) 27 | } 28 | $registry.Dispose() 29 | } 30 | ``` 31 | 32 | Configure wallpaper for multiple users(cannot be changed in the ui): 33 | 34 | ```powershell 35 | $settings = 36 | [PSCustomObject]@{ 37 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" 38 | Name = "DesktopImageStatus" 39 | Value = 1 40 | }, 41 | [PSCustomObject]@{ 42 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP" 43 | Name = "DesktopImagePath" 44 | Value = "C:\wallpaper.png" 45 | } 46 | 47 | foreach ($setting in ($settings | group Path)) { 48 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 49 | if ($null -eq $registry) { 50 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 51 | } 52 | $setting.Group | % { 53 | $registry.SetValue($_.name, $_.value) 54 | } 55 | $registry.Dispose() 56 | } 57 | ``` 58 | 59 | Configure wallpaper for multiple users(can be changed in the ui): 60 | 61 | ```powershell 62 | # Configuration for single user 63 | $settings = 64 | [PSCustomObject]@{ 65 | Path = "Control Panel\Desktop" 66 | Name = "WallPaper" 67 | Value = "C:\wallpaper.png" 68 | } 69 | 70 | foreach ($setting in ($settings | group Path)) { 71 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 72 | if ($null -eq $registry) { 73 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 74 | } 75 | $setting.Group | % { 76 | $registry.SetValue($_.name, $_.value) 77 | } 78 | $registry.Dispose() 79 | } 80 | 81 | # Configuration for other users 82 | [IO.DirectoryInfo]$provisioning = "$($env:PROGRAMDATA)\provisioning" 83 | 84 | if(!$provisioning.Exists){ 85 | $provisioning.Create() 86 | } 87 | 88 | @" 89 | Windows Registry Editor Version 5.00 90 | 91 | [HKEY_CURRENT_USER\Control Panel\Desktop] 92 | "WallPaper"="C:\\wallpaper.png" 93 | 94 | "@ | Out-File "$($provisioning.FullName)\user-settings.reg" -Encoding unicode -Force 95 | 96 | $configure_active_setup = @{ 97 | Path = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\UserSettings" 98 | ErrorAction = "SilentlyContinue" 99 | } 100 | 101 | $configure_run_once = @{ 102 | Name = "StubPath" 103 | Value = 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ImportUserRegistry /d "REG IMPORT {0}" /f' -f "$($provisioning.FullName)\user-settings.reg" 104 | } 105 | 106 | ni @configure_active_setup | New-ItemProperty @configure_run_once 107 | ``` 108 | 109 | ## Related videos 110 | 111 | Other powershell videos: 112 | 113 | * [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 114 | * [Windows Registry](https://www.youtube.com/playlist?list=PLVncjTDMNQ4TZrwwuYuZBZhpjs6YWw7sQ) -------------------------------------------------------------------------------- /Configure HKLM Run and RunOnce/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Configure HKLM Run and RunOnce 2 | 3 | Documentation: 4 | 5 | * [Run and RunOnce Registry Keys](https://learn.microsoft.com/en-us/windows/win32/setupapi/run-and-runonce-registry-keys) 6 | 7 | Run vs RunOnce in HKLM hive 8 | 9 | * Process that is executed from RunOnce will be elevated and process executed using Run will not be elavated 10 | * Commands in RunOnce will be executed only for administrator accounts 11 | * Registry entry in RunOnce will be deleted after execution 12 | * Commands in Run will be executed for everyone 13 | 14 | Registry locations 15 | 16 | * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce 17 | * HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 18 | 19 | Configure Run and RunOnce: 20 | 21 | ```powershell 22 | $settings = 23 | [PSCustomObject]@{ 24 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 25 | Name = "execute_notepad_from_run" 26 | Value = "C:\Windows\notepad.exe" 27 | }, 28 | [PSCustomObject]@{ 29 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" 30 | Name = "execute_notepad_from_runonce" 31 | Value = "C:\Windows\notepad.exe" 32 | } 33 | 34 | foreach ($setting in ($settings | group Path)) { 35 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 36 | if ($null -eq $registry) { 37 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 38 | } 39 | $setting.Group | % { 40 | if (!$_.Type) { 41 | $registry.SetValue($_.name, $_.value) 42 | } 43 | else { 44 | $registry.SetValue($_.name, $_.value, $_.type) 45 | } 46 | } 47 | $registry.Dispose() 48 | } 49 | ``` 50 | 51 | Configure RunOnce to execute powershell script: 52 | 53 | ```powershell 54 | $settings = 55 | [PSCustomObject]@{ 56 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" 57 | Name = "execute_script" 58 | Value = "powershell.exe -ExecutionPolicy Bypass -File C:\script.ps1" 59 | } 60 | 61 | foreach ($setting in ($settings | group Path)) { 62 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 63 | if ($null -eq $registry) { 64 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 65 | } 66 | $setting.Group | % { 67 | if (!$_.Type) { 68 | $registry.SetValue($_.name, $_.value) 69 | } 70 | else { 71 | $registry.SetValue($_.name, $_.value, $_.type) 72 | } 73 | } 74 | $registry.Dispose() 75 | } 76 | ``` 77 | 78 | Remove specific registry entries: 79 | 80 | ```powershell 81 | $remove_registry_entries = 82 | [PSCustomObject]@{ 83 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 84 | Name = "execute_notepad_from_run" 85 | } 86 | 87 | foreach ($entry in ($remove_registry_entries | Group Path)) { 88 | $key = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($entry.name, $true) 89 | if ($null -eq $key) { 90 | continue 91 | } 92 | foreach ($item in $entry.Group.Where({ $null -ne $key.GetValue($_.name) })) { 93 | $key.DeleteValue($item.name, $true) 94 | } 95 | $key.Dispose() 96 | } 97 | ``` 98 | 99 | Remove all registry entries: 100 | 101 | ```powershell 102 | $remove_registry_entries = 103 | [PSCustomObject]@{ 104 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 105 | }, 106 | [PSCustomObject]@{ 107 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" 108 | } 109 | 110 | foreach($path in $remove_registry_entries.Path){ 111 | $key = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($path, $true) 112 | foreach($entry in $key.GetValueNames()){ 113 | $key.DeleteValue($entry, $true) 114 | } 115 | $key.Dispose() 116 | } 117 | ``` -------------------------------------------------------------------------------- /Firefox deploy bookmarks/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox deploy bookmarks 2 | 3 | Objective: 4 | 5 | * Firefox deploy bookmarks 6 | * youtube.com 7 | * google.com 8 | * social media 9 | * twitter.com 10 | * facebook.com 11 | 12 | PowerShell snippet: 13 | 14 | ```powershell 15 | $settings = 16 | [PSCustomObject]@{ # Youtube 17 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\1" 18 | Value = "" 19 | Name = "Title" # Mandatory 20 | }, 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\1" 23 | Value = "https://www.youtube.com" 24 | Name = "URL" # Mandatory 25 | }, 26 | [PSCustomObject]@{ 27 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\1" 28 | Value = "toolbar" # toolbar | menu 29 | Name = "Placement" 30 | }, 31 | [PSCustomObject]@{ 32 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\1" 33 | Value = "https://www.youtube.com/favicon.ico" 34 | Name = "Favicon" 35 | }, 36 | [PSCustomObject]@{ 37 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\1" 38 | Value = "" 39 | Name = "Folder" 40 | }, 41 | [PSCustomObject]@{ # Google 42 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\2" 43 | Value = "" 44 | Name = "Title" 45 | }, 46 | [PSCustomObject]@{ 47 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\2" 48 | Value = "https://www.google.com" 49 | Name = "URL" 50 | }, 51 | [PSCustomObject]@{ 52 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\2" 53 | Value = "toolbar" 54 | Name = "Placement" 55 | }, 56 | [PSCustomObject]@{ 57 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\2" 58 | Value = "https://www.google.com/favicon.ico" 59 | Name = "Favicon" 60 | }, 61 | [PSCustomObject]@{ 62 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\2" 63 | Value = "" 64 | Name = "Folder" 65 | }, 66 | [PSCustomObject]@{ # Twitter 67 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\3" 68 | Value = "Twitter" 69 | Name = "Title" 70 | }, 71 | [PSCustomObject]@{ 72 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\3" 73 | Value = "https://www.twitter.com" 74 | Name = "URL" 75 | }, 76 | [PSCustomObject]@{ 77 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\3" 78 | Value = "toolbar" 79 | Name = "Placement" 80 | }, 81 | [PSCustomObject]@{ 82 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\3" 83 | Value = "https://www.twitter.com/favicon.ico" 84 | Name = "Favicon" 85 | }, 86 | [PSCustomObject]@{ 87 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\3" 88 | Value = "Social Media" 89 | Name = "Folder" 90 | }, 91 | [PSCustomObject]@{ # Facebook 92 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\4" 93 | Value = "Facebook" 94 | Name = "Title" 95 | }, 96 | [PSCustomObject]@{ 97 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\4" 98 | Value = "https://www.facebook.com" 99 | Name = "URL" 100 | }, 101 | [PSCustomObject]@{ 102 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\4" 103 | Value = "toolbar" 104 | Name = "Placement" 105 | }, 106 | [PSCustomObject]@{ 107 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\4" 108 | Value = "https://www.facebook.com/favicon.ico" 109 | Name = "Favicon" 110 | }, 111 | [PSCustomObject]@{ 112 | Path = "SOFTWARE\Policies\Mozilla\Firefox\Bookmarks\4" 113 | Value = "Social Media" 114 | Name = "Folder" 115 | } | group Path 116 | 117 | foreach($setting in $settings){ 118 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 119 | if ($null -eq $registry) { 120 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 121 | } 122 | $setting.Group | %{ 123 | $registry.SetValue($_.name, $_.value) 124 | } 125 | $registry.Dispose() 126 | } 127 | ``` 128 | -------------------------------------------------------------------------------- /Windows 11 pin software to taskbar/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 pin software to taskbar 2 | 3 | Documentation: 4 | 5 | * [Configure Windows Taskbar](https://learn.microsoft.com/en-us/windows/configuration/taskbar/?pivots=windows-11) 6 | * [Find the Application User Model ID of an installed app](https://learn.microsoft.com/en-us/windows/configuration/store/find-aumid?tabs=ps) 7 | 8 | Taskbar layout sample: 9 | 10 | ```xml 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | ``` 29 | 30 | Show packagedAppId for Windows store apps: 31 | 32 | ```powershell 33 | Get-AppxPackage | select @{n='name';e={"$($_.PackageFamilyName)!app"}} | ?{$_.name -like "**"} 34 | ``` 35 | 36 | Pin icons to taskbar with powershell: 37 | 38 | ```powershell 39 | $taskbar_layout = 40 | @" 41 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | "@ 59 | 60 | # prepare provisioning folder 61 | [System.IO.FileInfo]$provisioning = "$($env:ProgramData)\provisioning\tasbar_layout.xml" 62 | if (!$provisioning.Directory.Exists) { 63 | $provisioning.Directory.Create() 64 | } 65 | 66 | $taskbar_layout | Out-File $provisioning.FullName -Encoding utf8 67 | 68 | $settings = [PSCustomObject]@{ 69 | Path = "SOFTWARE\Policies\Microsoft\Windows\Explorer" 70 | Value = $provisioning.FullName 71 | Name = "StartLayoutFile" 72 | Type = [Microsoft.Win32.RegistryValueKind]::ExpandString 73 | }, 74 | [PSCustomObject]@{ 75 | Path = "SOFTWARE\Policies\Microsoft\Windows\Explorer" 76 | Value = 1 77 | Name = "LockedStartLayout" 78 | } | group Path 79 | 80 | foreach ($setting in $settings) { 81 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 82 | if ($null -eq $registry) { 83 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 84 | } 85 | $setting.Group | % { 86 | if (!$_.Type) { 87 | $registry.SetValue($_.name, $_.value) 88 | } 89 | else { 90 | $registry.SetValue($_.name, $_.value, $_.type) 91 | } 92 | } 93 | $registry.Dispose() 94 | } 95 | ``` 96 | 97 | ## Related videos 98 | 99 | Other powershell videos 100 | 101 | [PowerShell playlist](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 102 | -------------------------------------------------------------------------------- /Export-StartLayout, Import-StartLayout alternatives for Windows 11/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Export-StartLayout, Import-StartLayout alternatives for Windows 11 2 | 3 | Documentation: 4 | 5 | * [Find the Application User Model ID of an installed app](https://learn.microsoft.com/en-us/windows/configuration/store/find-aumid?tabs=ps) 6 | 7 | Objectives: 8 | 9 | * Method 1: Modify start menu for NEW users by replicating Intune registry settings with powershell. 10 | * Can be used for new computers with Windows configuration designer or other computer provisioning tools 11 | * Method 2: Modify start menu for all users on the computer by deploying start2.bin file to all users on the computer 12 | 13 | ## Method 1 14 | 15 | Configure start menu with MDM policy via registry(for new users only): 16 | 17 | ```powershell 18 | $apps = 19 | "Microsoft.Windows.Explorer", 20 | "Microsoft.Windows.ControlPanel", 21 | "Microsoft.WindowsCalculator_8wekyb3d8bbwe!app", 22 | "Microsoft.Paint_8wekyb3d8bbwe!app", 23 | "C:\Windows\System32\cmd.exe", 24 | "C:\Windows\regedit.exe" 25 | 26 | $start_pins = @{ 27 | pinnedList = foreach ($app in $apps) { 28 | if ($app -match "\w:\\") { 29 | @{ 30 | desktopAppLink = $app 31 | } 32 | } 33 | elseif ($app -match "Microsoft\.Windows\.") { 34 | @{ 35 | desktopAppId = $app 36 | } 37 | } 38 | else { 39 | @{ 40 | packagedAppId = $app 41 | } 42 | } 43 | } 44 | } | ConvertTo-Json -Compress 45 | 46 | $settings = 47 | [PSCustomObject]@{ 48 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 49 | Value = $start_pins 50 | #Value = '{ "pinnedList": [] }' # only for remove everything 51 | Name = "ConfigureStartPins" 52 | }, 53 | [PSCustomObject]@{ 54 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 55 | Value = 1 56 | Name = "ConfigureStartPins_ProviderSet" 57 | }, 58 | [PSCustomObject]@{ 59 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 60 | Value = "B5292708-1619-419B-9923-E5D9F3925E71" 61 | Name = "ConfigureStartPins_WinningProvider" 62 | }, 63 | [PSCustomObject]@{ 64 | Path = "SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start" 65 | Value = $start_pins 66 | #Value = '{ "pinnedList": [] }' # only for remove everything 67 | Name = "ConfigureStartPins" 68 | }, 69 | [PSCustomObject]@{ 70 | Path = "SOFTWARE\Microsoft\PolicyManager\providers\B5292708-1619-419B-9923-E5D9F3925E71\default\Device\Start" 71 | Value = 1 72 | Name = "ConfigureStartPins_LastWrite" 73 | } | group Path 74 | 75 | foreach ($setting in $settings) { 76 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 77 | if ($null -eq $registry) { 78 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 79 | } 80 | $setting.Group | % { 81 | $registry.SetValue($_.name, $_.value) 82 | } 83 | $registry.Dispose() 84 | } 85 | ``` 86 | 87 | Show packagedAppId for Windows store apps: 88 | 89 | ```powershell 90 | Get-AppxPackage | select @{n='name';e={"$($_.PackageFamilyName)!app"}} | ?{$_.name -like "**"} 91 | ``` 92 | 93 | ## Method 2 94 | 95 | start2.bin file location: 96 | 97 | * %LOCALAPPDATA%\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\ 98 | 99 | Deploy start2.bin file from current user to all other users on the computer: 100 | 101 | ```powershell 102 | [System.IO.FileInfo]$start_layout = "$($env:LOCALAPPDATA)\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState\start2.bin" 103 | 104 | ls "C:\Users\" -Attributes Directory -Force | ?{$_.FullName -notin $env:USERPROFILE, $env:PUBLIC -and $_.Name -notin "All Users", "Default User"} | %{ 105 | 106 | [System.IO.DirectoryInfo]$destination = "$($_.FullName)\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState" 107 | 108 | if(!$destination.Exists){ 109 | $destination.Create() 110 | } 111 | 112 | $start_layout.CopyTo("$($destination)\start2.bin", $true) 113 | } 114 | ``` 115 | 116 | # Related videos 117 | 118 | [PowerShell: Get-AppxPackage, Remove-AppxPackage](https://youtu.be/SrjEV6rkoEQ)
119 | [PowerShell: Using Get-AppxProvisionedPackage, Remove-AppxProvisionedPackage to modify Online image](https://youtu.be/SevFgIkzAKk) 120 | -------------------------------------------------------------------------------- /Pause Windows 11 updates/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Pause Windows 11 updates 2 | 3 | Update settings location in registry: 4 | 5 | ```batch 6 | SOFTWARE\Microsoft\WindowsUpdate\UX\Settings 7 | SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings 8 | ``` 9 | 10 | Pause Windows Updates: 11 | 12 | ```powershell 13 | $pause_for_days = 30 14 | 15 | $date = Get-Date 16 | 17 | $pause_start = $date.ToUniversalTime().ToString( "yyyy-MM-ddTHH:mm:ssZ" ) 18 | $pause_end = $date.AddDays($pause_for_days).ToUniversalTime().ToString( "yyyy-MM-ddTHH:mm:ssZ" ) 19 | 20 | $settings = 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" 23 | Name = "PauseFeatureUpdatesEndTime" 24 | Value = $pause_end 25 | }, 26 | [PSCustomObject]@{ 27 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" 28 | Name = "PauseQualityUpdatesEndTime" 29 | Value = $pause_end 30 | }, 31 | [PSCustomObject]@{ 32 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" 33 | Name = "PauseUpdatesExpiryTime" 34 | Value = $pause_end 35 | }, 36 | [PSCustomObject]@{ 37 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" 38 | Name = "PauseFeatureUpdatesStartTime" 39 | Value = $pause_start 40 | }, 41 | [PSCustomObject]@{ 42 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" 43 | Name = "PauseQualityUpdatesStartTime" 44 | Value = $pause_start 45 | }, 46 | [PSCustomObject]@{ 47 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" 48 | Name = "PauseUpdatesStartTime" 49 | Value = $pause_start 50 | }, 51 | [PSCustomObject]@{ 52 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" 53 | Name = "PausedFeatureDate" 54 | Value = $pause_start 55 | }, 56 | [PSCustomObject]@{ 57 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" 58 | Name = "PausedQualityDate" 59 | Value = $pause_start 60 | }, 61 | [PSCustomObject]@{ 62 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" 63 | Name = "PausedFeatureStatus" 64 | Value = 1 65 | }, 66 | [PSCustomObject]@{ 67 | Path = "SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings" 68 | Name = "PausedQualityStatus" 69 | Value = 1 70 | } 71 | 72 | foreach ($setting in ($settings | group Path)) { 73 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 74 | if ($null -eq $registry) { 75 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 76 | } 77 | $setting.Group | % { 78 | $registry.SetValue($_.name, $_.value) 79 | } 80 | $registry.Dispose() 81 | } 82 | ``` 83 | 84 | Resume Windows Updates: 85 | 86 | ```powershell 87 | $settings = 88 | [PSCustomObject]@{ 89 | Name = 'PauseFeatureUpdatesEndTime' 90 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' 91 | }, 92 | [PSCustomObject]@{ 93 | Name = 'PauseQualityUpdatesEndTime' 94 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' 95 | }, 96 | [PSCustomObject]@{ 97 | Name = 'PauseUpdatesExpiryTime' 98 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' 99 | }, 100 | [PSCustomObject]@{ 101 | Name = 'PauseFeatureUpdatesStartTime' 102 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' 103 | }, 104 | [PSCustomObject]@{ 105 | Name = 'PauseQualityUpdatesStartTime' 106 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' 107 | }, 108 | [PSCustomObject]@{ 109 | Name = 'PauseUpdatesStartTime' 110 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UX\Settings' 111 | }, 112 | [PSCustomObject]@{ 113 | Name = 'PausedFeatureDate' 114 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings' 115 | }, 116 | [PSCustomObject]@{ 117 | Name = 'PausedQualityDate' 118 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings' 119 | }, 120 | [PSCustomObject]@{ 121 | Name = 'PausedFeatureStatus' 122 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings' 123 | }, 124 | [PSCustomObject]@{ 125 | Name = 'PausedQualityStatus' 126 | Path = 'SOFTWARE\Microsoft\WindowsUpdate\UpdatePolicy\Settings' 127 | } 128 | 129 | foreach ($setting in ($settings | group Path)) { 130 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 131 | if ($null -eq $registry) { 132 | continue 133 | } 134 | 135 | foreach ($item in $setting.Group.Where({ $null -ne $registry.GetValue($_.name) })) { 136 | $registry.DeleteValue($item.name, $true) 137 | } 138 | $registry.Dispose() 139 | } 140 | ``` -------------------------------------------------------------------------------- /Enable This PC, Recycle Bin, User's Files, Control Panel and Network Desktop Icons/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Enable This PC, Recycle Bin, User's Files, Control Panel and Network Desktop Icons 2 | 3 | Objectives: 4 | 5 | * Enable icons for single user 6 | * Enable icons for all users 7 | 8 | Enable desktop icons for current user: 9 | 10 | ```powershell 11 | # Icons 12 | $desktop_icons = 13 | [pscustomobject]@{ 14 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 15 | Value = 0 16 | Name = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" 17 | Description = "This PC" 18 | }, 19 | [pscustomobject]@{ 20 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 21 | Value = 0 22 | Name = "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" 23 | Description = "Control Panel" 24 | }, 25 | [pscustomobject]@{ 26 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 27 | Value = 0 28 | Name = "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" 29 | Description = "User's Files" 30 | }, 31 | [pscustomobject]@{ 32 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 33 | Value = 0 34 | Name = "{645FF040-5081-101B-9F08-00AA002F954E}" 35 | Description = "Recycle Bin" 36 | }, 37 | [pscustomobject]@{ 38 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 39 | Value = 0 40 | Name = "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" 41 | Description = "Network" 42 | } | group Path 43 | 44 | foreach($setting in $desktop_icons){ 45 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 46 | if ($null -eq $registry) { 47 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 48 | } 49 | $setting.Group | %{ 50 | $registry.SetValue($_.name, $_.value) 51 | } 52 | $registry.Dispose() 53 | } 54 | ``` 55 | 56 | Enable desktop icons for all users: 57 | 58 | ```powershell 59 | $desktop_icons = 60 | [pscustomobject]@{ 61 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 62 | Value = 0 63 | Name = "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" 64 | Description = "This PC" 65 | }, 66 | [pscustomobject]@{ 67 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 68 | Value = 0 69 | Name = "{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}" 70 | Description = "Control Panel" 71 | }, 72 | [pscustomobject]@{ 73 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 74 | Value = 0 75 | Name = "{59031a47-3f72-44a7-89c5-5595fe6b30ee}" 76 | Description = "User's Files" 77 | }, 78 | [pscustomobject]@{ 79 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 80 | Value = 0 81 | Name = "{645FF040-5081-101B-9F08-00AA002F954E}" 82 | Description = "Recycle Bin" 83 | }, 84 | [pscustomobject]@{ 85 | Path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 86 | Value = 0 87 | Name = "{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" 88 | Description = "Network" 89 | } | group Path 90 | 91 | foreach($setting in $desktop_icons){ 92 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 93 | if ($null -eq $registry) { 94 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 95 | } 96 | $setting.Group | %{ 97 | $registry.SetValue($_.name, $_.value) 98 | } 99 | $registry.Dispose() 100 | } 101 | 102 | # Export current users settings 103 | [System.IO.FileInfo]$destination = "$($env:ProgramData)\provisioning\Desktop_Icons.reg" 104 | 105 | if(!$destination.Directory.Exists){ 106 | $destination.Directory.Create() 107 | } 108 | 109 | $key_path = "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" 110 | 111 | $export = @{ 112 | FilePath = "reg" 113 | ArgumentList = "export" ,"HKCU\$($key_path)", $destination.FullName, "/y" 114 | Wait = $true 115 | NoNewWindow = $true 116 | } 117 | Start-Process @export 118 | 119 | # Configure active setup to import registry file for all users 120 | ni "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\importDesktopIcons" | New-ItemProperty -Name "StubPath" -Value ('reg import "{0}"' -f $destination.FullName) 121 | ``` 122 | 123 | ## Related videos 124 | 125 | Windows Registry 126 | 127 | [Windows Registry: Run and RunOnce](https://youtu.be/zgFzCq5uEPw)
128 | [Windows Registry: Active Setup](https://youtu.be/HrVJ7wdvfmo) -------------------------------------------------------------------------------- /Get-LocalUser, New-LocalUser, Set-LocalUser, Disable-LocalUser and Enable, Remove/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-LocalUser, New-LocalUser, Set-LocalUser, Disable-LocalUser and Enable, Remove 2 | 3 | Documentation: 4 | 5 | * [Get-LocalUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/get-localuser?view=powershell-5.1) 6 | * [New-LocalUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/new-localuser?view=powershell-5.1) 7 | * [Set-LocalUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/set-localuser?view=powershell-5.1) 8 | * [Disable-LocalUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/disable-localuser?view=powershell-5.1) 9 | * [Enable-LocalUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/enable-localuser?view=powershell-5.1) 10 | * [Remove-LocalUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.localaccounts/remove-localuser?view=powershell-5.1) 11 | 12 | ### Get-LocalUser 13 | 14 | Get all local user accounts: 15 | 16 | ```powershell 17 | Get-LocalUser 18 | ``` 19 | 20 | Get all properties: 21 | 22 | ```powershell 23 | Get-LocalUser | select * 24 | ``` 25 | 26 | Select specific properties: 27 | 28 | ```powershell 29 | Get-LocalUser | select Name, Enabled, PasswordLastSet 30 | ``` 31 | 32 | Get only Enabled users: 33 | 34 | ```powershell 35 | Get-LocalUser | ?{$_.Enabled} | select Name, Enabled, PasswordLastSet 36 | ``` 37 | 38 | ### New-LocalUser 39 | 40 | Create user: 41 | 42 | ```powershell 43 | New-LocalUser 44 | ``` 45 | 46 | Create user without password and add him to Users group: 47 | 48 | ```powershell 49 | $new_user = @{ 50 | Name = 'bobUser' 51 | NoPassword = $true 52 | } 53 | $user = New-LocalUser @new_user 54 | $user | Set-LocalUser -PasswordNeverExpires $true 55 | $user | Add-LocalGroupMember -Group "Users" 56 | ``` 57 | 58 | Create user without password and add him to Administrators group: 59 | 60 | ```powershell 61 | $new_user = @{ 62 | Name = 'bobAdmin' 63 | NoPassword = $true 64 | } 65 | $user = New-LocalUser @new_user 66 | $user | Set-LocalUser -PasswordNeverExpires $true 67 | $user | Add-LocalGroupMember -Group "Administrators" 68 | ``` 69 | 70 | Create multiple users with password and add them to Administrators group: 71 | 72 | ```powershell 73 | $new_users = @{ 74 | Name = 'user01' 75 | Password = (ConvertTo-SecureString -AsPlainText "Password55" -Force) 76 | }, 77 | @{ 78 | Name = 'user02' 79 | Password = (ConvertTo-SecureString -AsPlainText "Password55" -Force) 80 | }, 81 | @{ 82 | Name = 'user03' 83 | Password = (ConvertTo-SecureString -AsPlainText "Password55" -Force) 84 | } 85 | 86 | foreach ($new_user in $new_users) { 87 | $user = New-LocalUser @new_user 88 | $user | Set-LocalUser -PasswordNeverExpires $true 89 | $user | Add-LocalGroupMember -Group "Administrators" 90 | } 91 | ``` 92 | 93 | Create user with passwordand add him to Administrators group: 94 | 95 | ```powershell 96 | Get-Credential | select @{n = 'Name'; e = { $_.UserName } }, 97 | @{n = 'Password'; e = { $_.Password } } | New-LocalUser -PasswordNeverExpires | Add-LocalGroupMember -Group "Administrators" 98 | ``` 99 | 100 | ### Disable-LocalUser 101 | 102 | Disable single user: 103 | 104 | ```powershell 105 | Disable-LocalUser user02 106 | ``` 107 | 108 | Disable multiple users: 109 | 110 | ```powershell 111 | Disable-LocalUser 'user01', 'user02', 'user03' 112 | ``` 113 | 114 | Disable filtered users: 115 | 116 | ```powershell 117 | Get-LocalUser | ?{$_.Enabled -and $_.Name -ne 'admin'} | Disable-LocalUser 118 | ``` 119 | 120 | ### Enable-LocalUser 121 | 122 | Enable single user: 123 | 124 | ```powershell 125 | Enable-LocalUser user01 126 | ``` 127 | 128 | Enable filtered users: 129 | 130 | ```powershell 131 | Get-LocalUser | ?{!$_.Enabled -and $_.Name -eq 'administrator'} | Enable-LocalUser 132 | ``` 133 | 134 | ### Set-LocalUser 135 | 136 | Set password for administrator user: 137 | 138 | ```powershell 139 | Set-LocalUser 'administrator' -Password (ConvertTo-SecureString -AsPlainText "Password55" -Force) 140 | ``` 141 | 142 | ### Remove-LocalUser 143 | 144 | Remove single user: 145 | 146 | ```powershell 147 | Remove-LocalUser user02 148 | ``` 149 | 150 | Exclude users from the list and remove everything else 151 | 152 | ```powershell 153 | $exclude = 154 | 'WDAGUtilityAccount', 155 | 'DefaultAccount', 156 | 'Administrator', 157 | 'Guest', 158 | 'admin' 159 | 160 | $users = Get-LocalUser 161 | 162 | foreach($user in $users.Where({$_.name -notin $exclude})){ 163 | $user | Remove-LocalUser 164 | } 165 | ``` -------------------------------------------------------------------------------- /Firefox change default search engine/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Firefox change default search engine 2 | 3 | Objective: 4 | 5 | * Firefox change default search engine 6 | 7 | Notes: Works ONLY for Firefox ESR
8 | 9 | 10 | 11 | Download Firefox ESR
12 | 13 | [Firefox ESR](https://www.mozilla.org/en-US/firefox/all/#product-desktop-esr) 14 | 15 | Providers:
16 | 17 | * google: https://www.google.com/search?q={searchTerms} 18 | * duckduckgo: https://duckduckgo.com/?q={searchTerms} 19 | * bing: https://www.bing.com/search?q={searchTerms} 20 | * yahoo: https://search.yahoo.com/search?p={searchTerms} 21 | * yandex: https://yandex.com/search/?text={searchTerms} 22 | 23 | PowerShell set duckduckgo as default search provider: 24 | 25 | ```powershell 26 | $settings = 27 | [PSCustomObject]@{ 28 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines" 29 | Value = "duckduckgo" 30 | Name = "Default" 31 | }, 32 | [PSCustomObject]@{ 33 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 34 | Value = "https://duckduckgo.com/?q={searchTerms}" 35 | Name = "URLTemplate" 36 | }, 37 | [PSCustomObject]@{ 38 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 39 | Value = "https://duckduckgo.com/favicon.ico" 40 | Name = "IconURL" 41 | }, 42 | [PSCustomObject]@{ 43 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 44 | Value = "duck" 45 | Name = "Alias" 46 | }, 47 | [PSCustomObject]@{ 48 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 49 | Value = "GET" 50 | Name = "Method" 51 | }, 52 | [PSCustomObject]@{ 53 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 54 | Value = "duckduckgo" 55 | Name = "Name" 56 | }, 57 | [PSCustomObject]@{ 58 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 59 | Value = "" 60 | Name = "Description" 61 | }, 62 | [PSCustomObject]@{ 63 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 64 | Value = "" 65 | Name = "Encoding" 66 | }, 67 | [PSCustomObject]@{ 68 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 69 | Value = "" 70 | Name = "PostData" 71 | }, 72 | [PSCustomObject]@{ 73 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 74 | Value = "" 75 | Name = "SuggestURLTemplate" 76 | } | group Path 77 | 78 | foreach($setting in $settings){ 79 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 80 | if ($null -eq $registry) { 81 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 82 | } 83 | $setting.Group | %{ 84 | $registry.SetValue($_.name, $_.value) 85 | } 86 | $registry.Dispose() 87 | } 88 | ``` 89 | 90 | PowerShell set bing as default search provider: 91 | 92 | ```powershell 93 | $settings = 94 | [PSCustomObject]@{ 95 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines" 96 | Value = "bing" 97 | Name = "Default" 98 | }, 99 | [PSCustomObject]@{ 100 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 101 | Value = "https://www.bing.com/search?q={searchTerms}" 102 | Name = "URLTemplate" 103 | }, 104 | [PSCustomObject]@{ 105 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 106 | Value = "https://www.bing.com/favicon.ico" 107 | Name = "IconURL" 108 | }, 109 | [PSCustomObject]@{ 110 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 111 | Value = "bing" 112 | Name = "Alias" 113 | }, 114 | [PSCustomObject]@{ 115 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 116 | Value = "GET" 117 | Name = "Method" 118 | }, 119 | [PSCustomObject]@{ 120 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 121 | Value = "bing" 122 | Name = "Name" 123 | }, 124 | [PSCustomObject]@{ 125 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 126 | Value = "" 127 | Name = "Description" 128 | }, 129 | [PSCustomObject]@{ 130 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 131 | Value = "" 132 | Name = "Encoding" 133 | }, 134 | [PSCustomObject]@{ 135 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 136 | Value = "" 137 | Name = "PostData" 138 | }, 139 | [PSCustomObject]@{ 140 | Path = "SOFTWARE\Policies\Mozilla\Firefox\SearchEngines\Add\1" 141 | Value = "" 142 | Name = "SuggestURLTemplate" 143 | } | group Path 144 | 145 | foreach($setting in $settings){ 146 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 147 | if ($null -eq $registry) { 148 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 149 | } 150 | $setting.Group | %{ 151 | $registry.SetValue($_.name, $_.value) 152 | } 153 | $registry.Dispose() 154 | } 155 | ``` -------------------------------------------------------------------------------- /Configure Privacy and Security App permissions settings/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Configure Privacy and Security App permissions settings 2 | 3 | Notes: 4 | 5 | * Disabling Web Cam and Microphone not recommended 6 | 7 | Powershell snippet: 8 | 9 | ```powershell 10 | $windows_settings = 11 | [PSCustomObject]@{ # Dont recommend 12 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam" 13 | Value = "Deny" # "Allow" 14 | Name = "Value" 15 | }, 16 | [PSCustomObject]@{ # Dont recommend 17 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" 18 | Value = "Deny" # "Allow" 19 | Name = "Value" 20 | }, 21 | [PSCustomObject]@{ 22 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" 23 | Value = "Deny" # "Allow" 24 | Name = "Value" 25 | }, 26 | [PSCustomObject]@{ 27 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" 28 | Value = "Deny" # "Allow" 29 | Name = "Value" 30 | }, 31 | [PSCustomObject]@{ 32 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" 33 | Value = "Deny" # "Allow" 34 | Name = "Value" 35 | }, 36 | [PSCustomObject]@{ 37 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts" 38 | Value = "Deny" # "Allow" 39 | Name = "Value" 40 | }, 41 | [PSCustomObject]@{ 42 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments" 43 | Value = "Deny" # "Allow" 44 | Name = "Value" 45 | }, 46 | [PSCustomObject]@{ 47 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCall" 48 | Value = "Deny" # "Allow" 49 | Name = "Value" 50 | }, 51 | [PSCustomObject]@{ 52 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory" 53 | Value = "Deny" # "Allow" 54 | Name = "Value" 55 | }, 56 | [PSCustomObject]@{ 57 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email" 58 | Value = "Deny" # "Allow" 59 | Name = "Value" 60 | }, 61 | [PSCustomObject]@{ 62 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks" 63 | Value = "Deny" # "Allow" 64 | Name = "Value" 65 | }, 66 | [PSCustomObject]@{ 67 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat" 68 | Value = "Deny" # "Allow" 69 | Name = "Value" 70 | }, 71 | [PSCustomObject]@{ 72 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios" 73 | Value = "Deny" # "Allow" 74 | Name = "Value" 75 | }, 76 | [PSCustomObject]@{ 77 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" 78 | Value = "Deny" # "Allow" 79 | Name = "Value" 80 | }, 81 | [PSCustomObject]@{ 82 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" 83 | Value = "Deny" # "Allow" 84 | Name = "Value" 85 | }, 86 | [PSCustomObject]@{ 87 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" 88 | Value = "Deny" # "Allow" 89 | Name = "Value" 90 | }, 91 | [PSCustomObject]@{ 92 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\downloadsFolder" 93 | Value = "Deny" # "Allow" 94 | Name = "Value" 95 | }, 96 | [PSCustomObject]@{ 97 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\musicLibrary" 98 | Value = "Deny" # "Allow" 99 | Name = "Value" 100 | }, 101 | [PSCustomObject]@{ 102 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" 103 | Value = "Deny" # "Allow" 104 | Name = "Value" 105 | }, 106 | [PSCustomObject]@{ 107 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" 108 | Value = "Deny" # "Allow" 109 | Name = "Value" 110 | }, 111 | [PSCustomObject]@{ 112 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" 113 | Value = "Deny" # "Allow" 114 | Name = "Value" 115 | }, 116 | [PSCustomObject]@{ 117 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureProgrammatic" 118 | Value = "Deny" # "Allow" 119 | Name = "Value" 120 | }, 121 | [PSCustomObject]@{ 122 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureWithoutBorder" 123 | Value = "Deny" # "Allow" 124 | Name = "Value" 125 | } | group Path 126 | 127 | foreach($setting in $windows_settings){ 128 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 129 | if ($null -eq $registry) { 130 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 131 | } 132 | $setting.Group | %{ 133 | $registry.SetValue($_.name, $_.value) 134 | } 135 | $registry.Dispose() 136 | } 137 | ``` 138 | -------------------------------------------------------------------------------- /Using Get-AppxProvisionedPackage, Remove-AppxProvisionedPackage to modify Online image/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Using Get-AppxProvisionedPackage, Remove-AppxProvisionedPackage to modify Online image 2 | 3 | Documentation: 4 | 5 | * [Get-AppxProvisionedPackage](https://learn.microsoft.com/en-us/powershell/module/dism/get-appxprovisionedpackage?view=windowsserver2022-ps) 6 | * [Remove-AppxProvisionedPackage](https://learn.microsoft.com/en-us/powershell/module/dism/remove-appxprovisionedpackage?view=windowsserver2022-ps) 7 | 8 | Notes: 9 | 10 | * This video is the same as [PowersShell: Get-AppxPackage, Remove-AppxPackage](https://youtu.be/SrjEV6rkoEQ) 11 | 12 | List provisioning packages: 13 | 14 | ```powershell 15 | Get-AppxProvisionedPackage -Online 16 | ``` 17 | 18 | Get-AppxProvisionedPackage available properties: 19 | 20 | ```powershell 21 | 22 | TypeName: Microsoft.Dism.Commands.AppxPackageObject 23 | 24 | Name MemberType Definition 25 | ---- ---------- ---------- 26 | Architecture Property uint32 Architecture {get;set;} 27 | Build Property uint32 Build {get;set;} 28 | DisplayName Property string DisplayName {get;set;} 29 | InstallLocation Property string InstallLocation {get;set;} 30 | LogLevel Property Microsoft.Dism.Commands.LogLevel LogLevel {get;set;} 31 | LogPath Property string LogPath {get;set;} 32 | MajorVersion Property uint32 MajorVersion {get;set;} 33 | MinorVersion Property uint32 MinorVersion {get;set;} 34 | Online Property bool Online {get;set;} 35 | PackageName Property string PackageName {get;set;} 36 | Path Property string Path {get;set;} 37 | PublisherId Property string PublisherId {get;set;} 38 | Regions Property string Regions {get;set;} 39 | ResourceId Property string ResourceId {get;set;} 40 | RestartNeeded Property bool RestartNeeded {get;set;} 41 | Revision Property uint32 Revision {get;set;} 42 | ScratchDirectory Property string ScratchDirectory {get;set;} 43 | SysDrivePath Property string SysDrivePath {get;set;} 44 | WinPath Property string WinPath {get;set;} 45 | ``` 46 | 47 | Remove single appx provisioned package: 48 | 49 | ```powershell 50 | Remove-AppxProvisionedPackage -PackageName "Microsoft.WindowsCalculator_2020.2103.8.0_neutral_~_8wekyb3d8bbwe" -Online -AllUser 51 | ``` 52 | 53 | Remove multiple app packages for all existing user: 54 | 55 | ```powershell 56 | # Don't recommended removing 57 | #"Microsoft.WindowsNotepad" 58 | #"Microsoft.Paint" 59 | #"Microsoft.WindowsCalculator" 60 | #"Microsoft.XboxGamingOverlay" 61 | #"Microsoft.Windows.Photos" 62 | 63 | # System components 64 | #"Microsoft.YourPhone" 65 | #"Microsoft.Windows.DevHome" 66 | #"Microsoft.GetHelp" 67 | #"Microsoft.Getstarted" 68 | #"Microsoft.WindowsStore" 69 | #"MicrosoftWindows.CrossDevice" 70 | 71 | $app_packages = 72 | "Microsoft.WindowsCamera", 73 | "Clipchamp.Clipchamp", 74 | "Microsoft.WindowsAlarms", 75 | "Microsoft.549981C3F5F10", # Cortana 76 | "Microsoft.WindowsFeedbackHub", 77 | "microsoft.windowscommunicationsapps", 78 | "Microsoft.WindowsMaps", 79 | "Microsoft.ZuneMusic", 80 | "Microsoft.BingNews", 81 | "Microsoft.Todos", 82 | "Microsoft.ZuneVideo", 83 | "Microsoft.MicrosoftOfficeHub", 84 | "Microsoft.OutlookForWindows", 85 | "Microsoft.People", 86 | "Microsoft.PowerAutomateDesktop", 87 | "MicrosoftCorporationII.QuickAssist", 88 | "Microsoft.ScreenSketch", 89 | "Microsoft.MicrosoftSolitaireCollection", 90 | "Microsoft.WindowsSoundRecorder", 91 | "Microsoft.MicrosoftStickyNotes", 92 | "Microsoft.BingWeather", 93 | "Microsoft.Xbox.TCUI", 94 | "Microsoft.GamingApp" 95 | 96 | Get-AppxProvisionedPackage -Online | ?{$_.DisplayName -in $app_packages} | Remove-AppxProvisionedPackage -Online -AllUser 97 | ``` 98 | 99 | List appx packages that are not in the list 100 | 101 | ```powershell 102 | $app_packages = 103 | "Microsoft.WindowsCamera", 104 | "Clipchamp.Clipchamp", 105 | "Microsoft.WindowsAlarms", 106 | "Microsoft.549981C3F5F10", # Cortana 107 | "Microsoft.WindowsFeedbackHub", 108 | "microsoft.windowscommunicationsapps", 109 | "Microsoft.WindowsMaps", 110 | "Microsoft.ZuneMusic", 111 | "Microsoft.BingNews", 112 | "Microsoft.Todos", 113 | "Microsoft.ZuneVideo", 114 | "Microsoft.MicrosoftOfficeHub", 115 | "Microsoft.OutlookForWindows", 116 | "Microsoft.People", 117 | "Microsoft.PowerAutomateDesktop", 118 | "MicrosoftCorporationII.QuickAssist", 119 | "Microsoft.ScreenSketch", 120 | "Microsoft.MicrosoftSolitaireCollection", 121 | "Microsoft.WindowsSoundRecorder", 122 | "Microsoft.MicrosoftStickyNotes", 123 | "Microsoft.BingWeather", 124 | "Microsoft.Xbox.TCUI", 125 | "Microsoft.GamingApp", 126 | "Microsoft.YourPhone", # System component 127 | "Microsoft.Windows.DevHome", # System component 128 | "Microsoft.GetHelp", # System component 129 | "Microsoft.Getstarted", # System component 130 | "Microsoft.WindowsStore", # System component 131 | "Microsoft.WindowsNotepad", # Don't recommended removing 132 | "Microsoft.Paint", # Don't recommended removing 133 | "Microsoft.WindowsCalculator", # Don't recommended removing 134 | "Microsoft.XboxGamingOverlay", # Don't recommended removing 135 | "Microsoft.Windows.Photos" # Don't recommended removing 136 | 137 | Get-AppxProvisionedPackage -Online | ?{$_.DisplayName -notin $app_packages} | select DisplayName 138 | ``` 139 | 140 | # Related videos 141 | 142 | [PowersShell: Get-AppxPackage, Remove-AppxPackage](https://youtu.be/SrjEV6rkoEQ)
143 | [PowersShell: Export-StartLayout, Import-StartLayout](https://youtu.be/j-8FmXk8ssg) 144 | -------------------------------------------------------------------------------- /Get-AppxPackage, Remove-AppxPackage/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Get-AppxPackage, Remove-AppxPackage 2 | 3 | Documentation: 4 | 5 | * [Get-AppxPackage](https://learn.microsoft.com/en-us/powershell/module/appx/get-appxpackage?view=windowsserver2022-ps) 6 | * [Remove-AppxPackage](https://learn.microsoft.com/en-us/powershell/module/appx/remove-appxpackage?view=windowsserver2022-ps) 7 | 8 | Get all windows app packages: 9 | 10 | ```powershell 11 | Get-AppxPackage -AllUsers 12 | ``` 13 | 14 | Get all removable windows app packages: 15 | 16 | ```powershell 17 | Get-AppxPackage -AllUsers | ?{!$_.NonRemovable} | select Name, PackageFullName 18 | ``` 19 | 20 | Get-AppxPackage available properties: 21 | 22 | ```powershell 23 | 24 | TypeName: Microsoft.Windows.Appx.PackageManager.Commands.AppxPackage 25 | 26 | Name MemberType Definition 27 | ---- ---------- ---------- 28 | Architecture Property Windows.System.ProcessorArchitecture Architecture {get;} 29 | Dependencies Property Microsoft.Windows.Appx.PackageManager.Commands.AppxPackage[] Dependencies {get;} 30 | InstallLocation Property string InstallLocation {get;} 31 | IsBundle Property bool IsBundle {get;} 32 | IsDevelopmentMode Property bool IsDevelopmentMode {get;} 33 | IsFramework Property bool IsFramework {get;} 34 | IsPartiallyStaged Property bool IsPartiallyStaged {get;} 35 | IsResourcePackage Property bool IsResourcePackage {get;} 36 | Name Property string Name {get;} 37 | NonRemovable Property bool NonRemovable {get;} 38 | PackageFamilyName Property string PackageFamilyName {get;} 39 | PackageFullName Property string PackageFullName {get;} 40 | PackageUserInformation Property System.Collections.Generic.IEnumerable.. 41 | Publisher Property string Publisher {get;} 42 | PublisherId Property string PublisherId {get;} 43 | ResourceId Property string ResourceId {get;} 44 | SignatureKind Property Windows.ApplicationModel.PackageSignatureKind SignatureKind {get;} 45 | Status Property Microsoft.Windows.Appx.PackageManager.Commands.AppxStatus Status {get;} 46 | Version Property string Version {get;} 47 | ``` 48 | 49 | Remove single app package for all existing user: 50 | 51 | ```powershell 52 | Remove-AppxPackage "Microsoft.OutlookForWindows_1.2024.111.100_x64__8wekyb3d8bbwe" -AllUsers 53 | ``` 54 | 55 | Remove multiple app packages for all existing user: 56 | 57 | ```powershell 58 | # Don't recommended removing 59 | #"Microsoft.WindowsNotepad" 60 | #"Microsoft.Paint" 61 | #"Microsoft.WindowsCalculator" 62 | #"Microsoft.XboxGamingOverlay" 63 | #"Microsoft.Windows.Photos" 64 | 65 | # System components 66 | #"Microsoft.YourPhone" 67 | #"Microsoft.Windows.DevHome" 68 | #"Microsoft.GetHelp" 69 | #"Microsoft.Getstarted" 70 | #"Microsoft.WindowsStore" 71 | 72 | $app_packages = 73 | "Microsoft.WindowsCamera", 74 | "Clipchamp.Clipchamp", 75 | "Microsoft.WindowsAlarms", 76 | "Microsoft.549981C3F5F10", # Cortana 77 | "Microsoft.WindowsFeedbackHub", 78 | "microsoft.windowscommunicationsapps", 79 | "Microsoft.WindowsMaps", 80 | "Microsoft.ZuneMusic", 81 | "Microsoft.BingNews", 82 | "Microsoft.Todos", 83 | "Microsoft.ZuneVideo", 84 | "Microsoft.MicrosoftOfficeHub", 85 | "Microsoft.OutlookForWindows", 86 | "Microsoft.People", 87 | "Microsoft.PowerAutomateDesktop", 88 | "MicrosoftCorporationII.QuickAssist", 89 | "Microsoft.ScreenSketch", 90 | "Microsoft.MicrosoftSolitaireCollection", 91 | "Microsoft.WindowsSoundRecorder", 92 | "Microsoft.MicrosoftStickyNotes", 93 | "Microsoft.BingWeather", 94 | "Microsoft.Xbox.TCUI", 95 | "Microsoft.GamingApp" 96 | 97 | Get-AppxPackage -AllUsers | ?{$_.name -in $app_packages} | Remove-AppxPackage -AllUsers 98 | ``` 99 | 100 | List appx packages that are not in the list 101 | 102 | ```powershell 103 | $app_packages = 104 | "Microsoft.WindowsCamera", 105 | "Clipchamp.Clipchamp", 106 | "Microsoft.WindowsAlarms", 107 | "Microsoft.549981C3F5F10", # Cortana 108 | "Microsoft.WindowsFeedbackHub", 109 | "microsoft.windowscommunicationsapps", 110 | "Microsoft.WindowsMaps", 111 | "Microsoft.ZuneMusic", 112 | "Microsoft.BingNews", 113 | "Microsoft.Todos", 114 | "Microsoft.ZuneVideo", 115 | "Microsoft.MicrosoftOfficeHub", 116 | "Microsoft.OutlookForWindows", 117 | "Microsoft.People", 118 | "Microsoft.PowerAutomateDesktop", 119 | "MicrosoftCorporationII.QuickAssist", 120 | "Microsoft.ScreenSketch", 121 | "Microsoft.MicrosoftSolitaireCollection", 122 | "Microsoft.WindowsSoundRecorder", 123 | "Microsoft.MicrosoftStickyNotes", 124 | "Microsoft.BingWeather", 125 | "Microsoft.Xbox.TCUI", 126 | "Microsoft.GamingApp", 127 | "Microsoft.YourPhone", # System component 128 | "Microsoft.Windows.DevHome", # System component 129 | "Microsoft.GetHelp", # System component 130 | "Microsoft.Getstarted", # System component 131 | "Microsoft.WindowsStore", # System component 132 | "Microsoft.WindowsNotepad", # Don't recommended removing 133 | "Microsoft.Paint", # Don't recommended removing 134 | "Microsoft.WindowsCalculator", # Don't recommended removing 135 | "Microsoft.XboxGamingOverlay", # Don't recommended removing 136 | "Microsoft.Windows.Photos" # Don't recommended removing 137 | 138 | Get-AppxPackage -AllUsers | ?{$_.name -notin $app_packages -and !$_.NonRemovable} | select name 139 | ``` 140 | 141 | # Related videos 142 | 143 | [PowerShell: Export-StartLayout, Import-StartLayout](https://youtu.be/j-8FmXk8ssg)
144 | [PowerShell: Using Get-AppxProvisionedPackage, Remove-AppxProvisionedPackage to modify Online image](https://youtu.be/SevFgIkzAKk) 145 | -------------------------------------------------------------------------------- /Windows 11 configure Start personalizations/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 configure Start personalizations 2 | 3 | Objectives: 4 | 5 | 6 | 7 | * Configure for current user 8 | * Configure for all users 9 | 10 | Disable everything for current user: 11 | 12 | ```powershell 13 | $settings = 14 | [PSCustomObject]@{ # Show recently added apps 15 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Start" 16 | Name = "ShowRecentList" 17 | Value = 0 # 0 Off, 1 On 18 | }, 19 | [PSCustomObject]@{ # Show recently added apps 20 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Start" 21 | Name = "ShowFrequentList" 22 | Value = 0 # 0 Off, 1 On 23 | }, 24 | [PSCustomObject]@{ # Show recommended files in start, recent files in File Explorer and items in Jump Lists 25 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 26 | Name = "Start_TrackDocs" 27 | Value = 0 # 0 Off, 1 On 28 | }, 29 | [PSCustomObject]@{ # show recommendations for tips, shortcuts, new apps and more 30 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 31 | Name = "Start_IrisRecommendations" 32 | Value = 0 # 0 Off, 1 On 33 | }, 34 | [PSCustomObject]@{ # show recommendations for tips, shortcuts, new apps and more 35 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 36 | Name = "Start_AccountNotifications" 37 | Value = 0 # 0 Off, 1 On 38 | } 39 | 40 | foreach ($setting in ($settings | group Path)) { 41 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 42 | if ($null -eq $registry) { 43 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 44 | } 45 | $setting.Group | % { 46 | if (!$_.Type) { 47 | $registry.SetValue($_.name, $_.value) 48 | } 49 | else { 50 | $registry.SetValue($_.name, $_.value, $_.type) 51 | } 52 | } 53 | $registry.Dispose() 54 | } 55 | ``` 56 | 57 | Enable everything for current user: 58 | 59 | ```powershell 60 | $settings = 61 | [PSCustomObject]@{ # Show recently added apps 62 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Start" 63 | Name = "ShowRecentList" 64 | Value = 1 # 0 Off, 1 On 65 | }, 66 | [PSCustomObject]@{ # Show recently added apps 67 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Start" 68 | Name = "ShowFrequentList" 69 | Value = 1 # 0 Off, 1 On 70 | }, 71 | [PSCustomObject]@{ # Show recommended files in start, recent files in File Explorer and items in Jump Lists 72 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 73 | Name = "Start_TrackDocs" 74 | Value = 1 # 0 Off, 1 On 75 | }, 76 | [PSCustomObject]@{ # show recommendations for tips, shortcuts, new apps and more 77 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 78 | Name = "Start_IrisRecommendations" 79 | Value = 1 # 0 Off, 1 On 80 | }, 81 | [PSCustomObject]@{ # show recommendations for tips, shortcuts, new apps and more 82 | Path = "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 83 | Name = "Start_AccountNotifications" 84 | Value = 1 # 0 Off, 1 On 85 | } 86 | 87 | foreach ($setting in ($settings | group Path)) { 88 | $registry = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($setting.Name, $true) 89 | if ($null -eq $registry) { 90 | $registry = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey($setting.Name, $true) 91 | } 92 | $setting.Group | % { 93 | if (!$_.Type) { 94 | $registry.SetValue($_.name, $_.value) 95 | } 96 | else { 97 | $registry.SetValue($_.name, $_.value, $_.type) 98 | } 99 | } 100 | $registry.Dispose() 101 | } 102 | ``` 103 | 104 | Disable everything for all users 105 | 106 | ```powershell 107 | [System.IO.DirectoryInfo]$provisioning = "$($env:ProgramData)\provisioning" 108 | 109 | if(!$provisioning.Exists){ 110 | $provisioning.Create() 111 | } 112 | 113 | @" 114 | Windows Registry Editor Version 5.00 115 | 116 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Start] 117 | "ShowRecentList"=dword:00000000 118 | "ShowFrequentList"=dword:00000000 119 | 120 | [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced] 121 | "Start_TrackDocs"=dword:00000000 122 | "Start_IrisRecommendations"=dword:00000000 123 | "Start_AccountNotifications"=dword:00000000 124 | "@ | Out-File "$($provisioning.FullName)\user_settings_registry.reg" -Encoding unicode -Force 125 | 126 | $settings = 127 | [PSCustomObject]@{ # Configure ActiveSetup to import registry file 128 | Path = "SOFTWARE\Microsoft\Active Setup\Installed Components\ImportUserRegistry" 129 | Name = "StubPath" 130 | Value = 'REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v ImportUserRegistry /d "REG IMPORT {0}" /f' -f "$($provisioning.FullName)\user_settings_registry.reg" 131 | } 132 | 133 | foreach ($setting in ($settings | group Path)) { 134 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 135 | if ($null -eq $registry) { 136 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 137 | } 138 | $setting.Group | % { 139 | if (!$_.Type) { 140 | $registry.SetValue($_.name, $_.value) 141 | } 142 | else { 143 | $registry.SetValue($_.name, $_.value, $_.type) 144 | } 145 | } 146 | $registry.Dispose() 147 | } 148 | ``` 149 | 150 | # More PowerShell snippet videos: 151 | 152 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) -------------------------------------------------------------------------------- /Windows 11 configure start menu folder icons/README.md: -------------------------------------------------------------------------------- 1 | # PowerShell: Windows 11 configure start menu folder icons 2 | 3 | Objectives: 4 | 5 | 6 | 7 | Apply start menu folder configuration: 8 | 9 | ```powershell 10 | $settings = 11 | [PSCustomObject]@{ # Start enable documents 12 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 13 | Name = "AllowPinnedFolderDocuments" 14 | Value = 1 15 | }, 16 | [PSCustomObject]@{ # Start enable documents 17 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 18 | Name = "AllowPinnedFolderDocuments_ProviderSet" 19 | Value = 1 20 | }, 21 | [PSCustomObject]@{ # Start enable downloads 22 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 23 | Name = "AllowPinnedFolderDownloads" 24 | Value = 1 25 | }, 26 | [PSCustomObject]@{ # Start enable downloads 27 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 28 | Name = "AllowPinnedFolderDownloads_ProviderSet" 29 | Value = 1 30 | }, 31 | [PSCustomObject]@{ # Start enable file explorer 32 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 33 | Name = "AllowPinnedFolderFileExplorer" 34 | Value = 1 35 | }, 36 | [PSCustomObject]@{ # Start enable file explorer 37 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 38 | Name = "AllowPinnedFolderFileExplorer_ProviderSet" 39 | Value = 1 40 | }, 41 | [PSCustomObject]@{ # Start enable music folder 42 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 43 | Name = "AllowPinnedFolderMusic" 44 | Value = 1 45 | }, 46 | [PSCustomObject]@{ # Start enable music folder 47 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 48 | Name = "AllowPinnedFolderMusic_ProviderSet" 49 | Value = 1 50 | }, 51 | [PSCustomObject]@{ # Start enable personal folder 52 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 53 | Name = "AllowPinnedFolderPersonalFolder" 54 | Value = 1 55 | }, 56 | [PSCustomObject]@{ # Start enable personal folder 57 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 58 | Name = "AllowPinnedFolderPersonalFolder_ProviderSet" 59 | Value = 1 60 | }, 61 | [PSCustomObject]@{ # Start enable pictures 62 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 63 | Name = "AllowPinnedFolderPictures" 64 | Value = 1 65 | }, 66 | [PSCustomObject]@{ # Start enable pictures 67 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 68 | Name = "AllowPinnedFolderPictures_ProviderSet" 69 | Value = 1 70 | }, 71 | [PSCustomObject]@{ # Start enable settings 72 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 73 | Name = "AllowPinnedFolderSettings" 74 | Value = 1 75 | }, 76 | [PSCustomObject]@{ # Start enable settings 77 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 78 | Name = "AllowPinnedFolderSettings_ProviderSet" 79 | Value = 1 80 | }, 81 | [PSCustomObject]@{ # Start enable videos 82 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 83 | Name = "AllowPinnedFolderVideos" 84 | Value = 1 85 | }, 86 | [PSCustomObject]@{ # Start enable videos 87 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 88 | Name = "AllowPinnedFolderVideos_ProviderSet" 89 | Value = 1 90 | }, 91 | [PSCustomObject]@{ # Start enable network 92 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 93 | Name = "AllowPinnedFolderNetwork" 94 | Value = 1 95 | }, 96 | [PSCustomObject]@{ # Start enable network 97 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 98 | Name = "AllowPinnedFolderNetwork_ProviderSet" 99 | Value = 1 100 | } 101 | 102 | foreach ($setting in ($settings | group Path)) { 103 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 104 | if ($null -eq $registry) { 105 | $registry = [Microsoft.Win32.Registry]::LocalMachine.CreateSubKey($setting.Name, $true) 106 | } 107 | $setting.Group | % { 108 | if (!$_.Type) { 109 | $registry.SetValue($_.name, $_.value) 110 | } 111 | else { 112 | $registry.SetValue($_.name, $_.value, $_.type) 113 | } 114 | } 115 | $registry.Dispose() 116 | } 117 | ``` 118 | 119 | Remove start menu folder configuration: 120 | 121 | ```powershell 122 | $settings = 123 | [PSCustomObject]@{ # Documents 124 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 125 | Name = "AllowPinnedFolderDocuments" 126 | }, 127 | [PSCustomObject]@{ # Documents 128 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 129 | Name = "AllowPinnedFolderDocuments_ProviderSet" 130 | }, 131 | [PSCustomObject]@{ # Downloads 132 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 133 | Name = "AllowPinnedFolderDownloads" 134 | }, 135 | [PSCustomObject]@{ # Downloads 136 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 137 | Name = "AllowPinnedFolderDownloads_ProviderSet" 138 | }, 139 | [PSCustomObject]@{ # File explorer 140 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 141 | Name = "AllowPinnedFolderFileExplorer" 142 | }, 143 | [PSCustomObject]@{ # File explorer 144 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 145 | Name = "AllowPinnedFolderFileExplorer_ProviderSet" 146 | }, 147 | [PSCustomObject]@{ # Music folder 148 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 149 | Name = "AllowPinnedFolderMusic" 150 | }, 151 | [PSCustomObject]@{ # Music folder 152 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 153 | Name = "AllowPinnedFolderMusic_ProviderSet" 154 | }, 155 | [PSCustomObject]@{ # Personal folder 156 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 157 | Name = "AllowPinnedFolderPersonalFolder" 158 | }, 159 | [PSCustomObject]@{ # Personal folder 160 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 161 | Name = "AllowPinnedFolderPersonalFolder_ProviderSet" 162 | }, 163 | [PSCustomObject]@{ # Pictures 164 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 165 | Name = "AllowPinnedFolderPictures" 166 | }, 167 | [PSCustomObject]@{ # Pictures 168 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 169 | Name = "AllowPinnedFolderPictures_ProviderSet" 170 | }, 171 | [PSCustomObject]@{ # Settings 172 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 173 | Name = "AllowPinnedFolderSettings" 174 | }, 175 | [PSCustomObject]@{ # Settings 176 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 177 | Name = "AllowPinnedFolderSettings_ProviderSet" 178 | }, 179 | [PSCustomObject]@{ # Videos 180 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 181 | Name = "AllowPinnedFolderVideos" 182 | }, 183 | [PSCustomObject]@{ # Videos 184 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 185 | Name = "AllowPinnedFolderVideos_ProviderSet" 186 | }, 187 | [PSCustomObject]@{ # Network 188 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 189 | Name = "AllowPinnedFolderNetwork" 190 | }, 191 | [PSCustomObject]@{ # Network 192 | Path = "SOFTWARE\Microsoft\PolicyManager\current\device\Start" 193 | Name = "AllowPinnedFolderNetwork_ProviderSet" 194 | } 195 | 196 | foreach($setting in ($settings | group Path)){ 197 | $registry = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey($setting.Name, $true) 198 | if ($null -eq $registry) { 199 | continue 200 | } 201 | 202 | foreach($item in $setting.Group.Where({$null -ne $registry.GetValue($_.name)})){ 203 | $registry.DeleteValue($item.name, $true) 204 | } 205 | $registry.Dispose() 206 | } 207 | ``` 208 | 209 | # More PowerShell snippet videos: 210 | 211 | [PowerShell](https://www.youtube.com/playlist?list=PLVncjTDMNQ4RDyVzbV0_kpXCScTMgUw_A) 212 | --------------------------------------------------------------------------------