FriendsOfMDT / PSD

PowerShell Deployment
MIT License
471 stars 72 forks source link

Offline deployment from media check not working #64

Open yckbrd opened 1 year ago

yckbrd commented 1 year ago

Deployment routine is not aborted when trying to deploy from offline media

yckbrd commented 1 year ago

Cause is that $tsenv:DeploymentMethod will not be set to MEDIA becuase Get-Volume | ? {-not [String]::IsNullOrWhiteSpace($_.DriveLetter) } | ? {$_.DriveType -eq 'Fixed'} | ? {$_.DriveLetter -ne 'X'} | ? {Test-Path "$($_.DriveLetter):Deploy\Scripts\Media.tag"} in PSDStart.ps1 (Line 331) is an empty object because the offline boot medium is not of DriveType 'Fixed' but CD-Rom. Furthermore a backslash is missing between $($_.DriveLetter): and Deploy\Scripts\Media.tag.

Changing the command pipeline to Get-Volume | ? {-not [String]::IsNullOrWhiteSpace($_.DriveLetter) } | ? {$_.DriveLetter -ne 'X'} | ? {Test-Path "$($_.DriveLetter):\Deploy\Scripts\Media.tag"} fixed the issue for me.

GeoSimos commented 1 year ago

Thank you for your feedback, we will test your script changes and decide if they make it to production.