Skip to content

Instantly share code, notes, and snippets.

View OSDeploy's full-sized avatar

David Segura - PowerShell MVP OSDeploy

View GitHub Profile
@OSDeploy
OSDeploy / User Desktop Icons.xml
Created January 30, 2019 04:30
Registry XML User Desktop Icons.xml
<Collection clsid="{53B533F5-224C-47e3-B01B-CA3B3F3FF4BF}" name="User Desktop Icons" status="Values generated by the Registry Wizard" changed="2018-08-14 18:53:29" uid="{E520FCA4-5860-42DE-A187-E1EAE82C71B0}"><Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="{018D5C66-4533-4307-9B53-224DE2ED1FE6}" descr="Wizard Generated Registry Item" image="12"><Properties action="U" hive="HKEY_CURRENT_USER" key="Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" name="{018D5C66-4533-4307-9B53-224DE2ED1FE6}" default="0" type="REG_DWORD" displayDecimal="0" value="00000001"/></Registry>
<Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="{20D04FE0-3AEA-1069-A2D8-08002B30309D}" descr="Wizard Generated Registry Item" image="12"><Properties action="U" hive="HKEY_CURRENT_USER" key="Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" name="{20D04FE0-3AEA-1069-A2D8-08002B30309D}" default="0" type="REG_DWORD" displayDecimal="0" value="00000000"/>
@OSDeploy
OSDeploy / Catalog Component 2019-01 Intel MicroCode Windows Server 2016 1607 x64 KB4091664.xml
Created January 18, 2019 05:35
Save as C:\OSBuilder\Content\Updates\Component\Catalog Component 2019-01 Intel MicroCode Windows Server 2016 1607 x64 KB4091664.xml
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>System.Management.Automation.PSCustomObject</T>
<T>System.Object</T>
</TN>
<MS>
<S N="Category">Component</S>
<S N="KBNumber">4091664</S>
<S N="KBTitle">2019-01 Intel MicroCode Windows Server 2016 1607 x64 KB4091664</S>
@OSDeploy
OSDeploy / Windows 10 x64 1809 Add-CapabilityRSAT.ps1
Last active April 8, 2019 08:41
OSBuilder PowerShell script for adding RSAT. Requires IsoExtract Content Windows 10 1809 FOD x64
# David Segura
# http://osdeploy.com
#
# OSBuilder Script
# Windows 10 x64 1809 Add-CapabilityRSAT.ps1
# Version 19.1.23
# https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/features-on-demand-non-language-fod
#======================================================================================
$FODContent = "$OSBuilderContent\IsoExtract\Windows 10 1809 FOD x64"
$CurrentLog = "$Info\logs\$((Get-Date).ToString('yyyy-MM-dd-HHmmss'))-RSAT.log"
@OSDeploy
OSDeploy / ExampleSessions.ps1
Created January 10, 2019 06:03
Quick introduction to Sessions.xml
#Sessions PowerShell ISE GridView
[xml]$XmlDocument = Get-Content -Path "$env:WinDir\servicing\Sessions\Sessions.xml"
$XmlDocument.Sessions.Session.Tasks.Phase.package | Out-GridView
#Cumulative Updates
$XmlDocument.Sessions.Session.Tasks.Phase.package | `
Where-Object {$_.id -like "*RollupFix*" -and $_.targetState -eq 'Installed'} | `
Sort-Object id
@OSDeploy
OSDeploy / WinPE WFP Dlls.inf
Created December 19, 2018 04:20
Adds WPF Dlls to WinPE
;===============================================================
; David Segura
; https://www.osdeploy.com
; WinPE WPF Dlls.inf
; ================== Purpose ===================================
; Restores WPF Functionality in WinPE 10 1809
; ================== Requires ==================================
; Win32\BPC47Langs.dll, Win32\BPC47mm.dll
; Win64\BPC47Langs.dll, Win64\BPC47mm.dll
; ================== Compatibility =============================
# David Segura
# http://osdeploy.com
#
# OSBuilder Script
# Add-DesktopIcons.ps1
#======================================================================================
# Load Registry Hives
#======================================================================================
$RegDefault = "$MountDirectory\Windows\System32\Config\Default"
# David Segura
# http://osdeploy.com
#
# OSBuilder Script
# Remove-OneDriveSetup.ps1
#======================================================================================
# Remove Files
#======================================================================================
if (Test-Path "$MountDirectory\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk") {
{
"TaskName": "OSBuild Scripts Test",
"TaskVersion": "18.12.12.0",
"TaskType": "OSBuild",
"MediaName": "Win10 Ent x64 1809 17763.168",
"BuildName": "",
"AddFeatureOnDemand": null,
"AddLanguageFeature": null,
"AddLanguageInterfacePack": null,
"AddLanguagePack": null,
@OSDeploy
OSDeploy / New-OSBUpdate20181206.ps1
Last active December 6, 2018 08:20
18.12.6 1809 Servicing Stack and Cumulative Update
#Paste this in PowerShell to add the new Servicing Stacks and Cumulative Updates
#Servicing Stacks
#https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/ADV990001
#https://support.microsoft.com/en-us/help/4470788/servicing-stack-update-for-windows-10
New-OSBUpdate -Category Servicing -KBNumber 4470788 -OS "Windows 10" -OSArch x64 -OSBuild 1809 -ReleaseDay 04 -ReleaseMonth 12 -ReleaseYear 2018 -URL http://download.windowsupdate.com/d/msdownload/update/software/secu/2018/11/windows10.0-kb4470788-x64_76f112f2b02b1716cdc0cab6c40f73764759cb0d.msu
New-OSBUpdate -Category Servicing -KBNumber 4470788 -OS "Windows 10" -OSArch x86 -OSBuild 1809 -ReleaseDay 04 -ReleaseMonth 12 -ReleaseYear 2018 -URL http://download.windowsupdate.com/c/msdownload/update/software/secu/2018/11/windows10.0-kb4470788-x86_4073458a480724d1f027856e79c09b82553c6c7f.msu
New-OSBUpdate -Category Servicing -KBNumber 4470788 -OS "Windows Server 2019" -OSArch x64 -OSBuild 1809 -ReleaseDay 04 -ReleaseMonth 12 -ReleaseYear 2018 -URL http:
#Windows 10 x64 1809
Write-Host "Windows 10 x64 1809" -ForegroundColor Cyan
Measure-Command {
Mount-WindowsImage -Path "C:\DEV\Optimize\Mount" `
-ImagePath "C:\DEV\Optimize\1809.wim" `
-Index 1 | Out-Null
}
Dismount-WindowsImage -Path "C:\DEV\Optimize\Mount" -Discard | Out-Null
#Windows 10 x64 1809 Optimize