private/Step-BuildBootGetContentWinpeshl.ps1
|
#Requires -PSEdition Core function Step-BuildBootGetContentWinpeshl { <# .SYNOPSIS Reads and stores the mounted image's winpeshl.ini content .DESCRIPTION Reads Windows\System32\winpeshl.ini from the mounted image as one string when the file exists. It stores the string in global BuildMedia.ContentWinpeshl and displays it through Out-Host. No state is changed when the file is absent. .EXAMPLE PS> Step-BuildBootGetContentWinpeshl Captures and displays winpeshl.ini when it exists in the mounted image. .INPUTS None. This function does not accept pipeline input. .OUTPUTS None. The file content is sent to the host and stored in global BuildMedia. .NOTES Author: David Segura Company: Recast Software Version: 0.1.0 Date: 2026-08-28 Requires global BuildMedia.MountPath. When the file exists, populates global BuildMedia.ContentWinpeshl with a System.String value. #> [CmdletBinding()] param () $MountPath = $global:BuildMedia.MountPath $winpeshlPath = "$MountPath\Windows\System32\winpeshl.ini" if (Test-Path $winpeshlPath) { Write-HostDateTimeDarkGray 'winpeshl.ini Content' [System.String]$ContentWinpeshl = Get-Content -Path $winpeshlPath -Raw $global:BuildMedia.ContentWinpeshl = $ContentWinpeshl $ContentWinpeshl | Out-Host } } |