Skip to content

Instantly share code, notes, and snippets.

@techdecline
Created December 3, 2018 09:38
Show Gist options
  • Select an option

  • Save techdecline/0c1cc5e6ba74e386be73620957946b8d to your computer and use it in GitHub Desktop.

Select an option

Save techdecline/0c1cc5e6ba74e386be73620957946b8d to your computer and use it in GitHub Desktop.
<#
.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