Scripting for OSD
On this page, we'll cover how create PowerShell scripts specific to DeployR Task Sequence environment, and then how to add them to your Task Sequence.
Connecting to the Task Sequence Environment
Import-Module DeployR.Utility[String]$MakeAlias = ${TSEnv:MakeAlias}
[String]$ModelAlias = ${TSEnv:ModelAlias}
[int]$OSImageBuild = ${TSEnv:OSImageBuild}
if ($MakeAlias -ne "Dell" -and $MakeAlias -ne "Lenovo" -and $MakeAlias -ne "HP" -and $MakeAlias -ne "Panasonic Corporation" -and $MakeAlias -ne "Microsoft") {
Write-Host "MakeAlias must be Microsoft, Dell, Lenovo, Panasonic or HP. Exiting script."
Exit 0
}$tsenv:LineOfBusiness = "RetailAgents"
$tsenv:HyperVHost = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters' -Name "HostName" -ErrorAction SilentlyContinue)

Last updated

