If you recently upgraded to ConfigMgr 2103 you may notice that your existing PowerShell script to create boot media fails after the upgrade. The reason is a code change that requires the New-CMBootableMedia cmdlet to run x86 PowerShell to work. According to a tweet from Mark Silvey (@configmgrdev), this will be addressed in upcoming releases. But for now, simply run your script in x86 PowerShell, and the problem goes away.
Symptom
Below is a sample script to generate a boot media ISO file in PowerShell
$ISOFile = "E:\Setup\Zero_Touch_WinPE_10_x64_OSD_Toolkit.iso"
$BootImage = Get-CMBootImage -Name "Boot image (x64)"
$DP = Get-CMDistributionPoint -SiteSystemServerName "DP01.corp.viamonstra.com"
$MP = Get-CMManagementPoint -SiteSystemServerName "CM01.corp.viamonstra.com"
# Delete ISO if exist
If (Test-Path $ISOFile){Remove-Item $ISOFile -Force -ErrorAction SilentlyContinue -Confirm:$false}
New-CMBootableMedia -MediaMode SiteBased -MediaType CdDvd -Path $ISOFile -AllowUnknownMachine -BootImage $BootImage -DistributionPoint $DP -ManagementPoint $MP
If you run the above script in ConfigMgr 2013, in x64 PowerShell, it will fail with the following error:
New-CMBootableMedia : Could not find the ConfigMgr UI installation directory

Workaround
Run the script from x86 PowerShell, and the problem goes away.

Happy Deployment, Johan
Hi. This is listed as fixed for hotfix KB9833643. Console update for Microsoft Endpoint Configuration Manager version 2103 – Configuration Manager | Microsoft Docs.
However, we are on 2111, and receive a different error, "Object reference not set to an instance of an object." Running in the x86 version of PowerShell allows the script to run.
Hi Dawn,
Thanks for the info.