Created
December 3, 2018 09:38
-
-
Save techdecline/0c1cc5e6ba74e386be73620957946b8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| This script adds branding information to the Windows Registry for OSD scenarios. | |
| .NOTES | |
| Name: Set-OSDBranding.ps1 | |
| AUTHOR: Cornelius Schuchardt, SoftEd Systems GmbH | |
| LASTEDIT: 21.08.2017 | |
| KEYWORDS: ConfigMgr, OSD, Branding, Registry | |
| #> | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [String] | |
| $TaskSequenceName, | |
| [Parameter()] | |
| [switch] | |
| $Deployment | |
| ) | |
| $key = "HKLM:\SOFTWARE\TECHDECLINE\Image" | |
| try { | |
| if ( Test-Path $key ) | |
| { | |
| $keyItem = Get-Item $key | |
| } | |
| else | |
| { | |
| New-Item -Path $key -Force -OutVariable keyItem | |
| } | |
| if ($Deployment) | |
| { | |
| New-ItemProperty -Path $keyItem.PSPath -Name "DeploymentTaskSequence" -PropertyType String -Value $TaskSequenceName | |
| New-ItemProperty -Path $keyItem.PSPath -Name "DeploymentDate" -PropertyType String -Value (Get-Date).ToString() | |
| } | |
| else | |
| { | |
| New-ItemProperty -Path $keyItem.PSPath -Name "CaptureTaskSequence" -PropertyType String -Value $TaskSequenceName | |
| New-ItemProperty -Path $keyItem.PSPath -Name "CaptureDate" -PropertyType String -Value (Get-Date).ToString() | |
| } | |
| } | |
| catch { | |
| return 1 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment