How can I get the size and current usage of the EFI partition on a disk?
I see that I can use the following command to at least the size of the partition, but I haven't found anything about how to get the current utilization:
get-partition |Where-Object{ $_.GptType -eq "{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}"} |Select Size
CodePudding user response:
As @JeroenMostert mentioned in the comments, this will work well:
Get-Volume -UniqueId "\\?\Volume$(((Get-Partition).Where{$_.GptType -eq '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}'}.Guid))\" | Select-Object Size, SizeRemaining
The GPT type is the GUID of the EFI partition on Windows, as seen here. This Unique ID is then passed into Get-Volume and will allow one to pull back the size & utilization information.