I have a WinPE iso copied to an USB stick. In the WinPE environment the user enters a physical disk number. I want to create a warning if this physical disk looks like the WinPE disk.
My solution is to check whether the folders on it corresponds to the WinPE disk content. To do this I need the drive letter in order to Test-Path
.
It looks like this solution Combine Get-Disk
info and LogicalDisk
info in PowerShell?.
But it does not work in WinPE environment: Some WMI doesn't work in Windows PE.
How can I check the content of the selected physical disk?