(Re)install the Windows WinRE partition (Microsoft KB5028997)

Summary
 Sometimes I'm a little zealous in clearing our 'unused' partitions on the likes of HP or Lenovo computers. In case you 'accidentally' remove the WinRE recovery partition, here is the official Microsoft procedure to recreate it. The KB5028997 URL is at the bottom of this article.
Procedure
  1. Open a Command Prompt window (cmd) as admin.
  2. To check the WinRE status, run reagentc /info. If the WinRE is installed, there should be a “Windows RE location” with a path to the WinRE directory. An example is, “Windows RE location: [file://%3f/GLOBALROOT/device/harddisk0/partition4/Recovery/WindowsRE]\\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE.” Here, the number after “harddisk” and “partition” is the index of the disk and partition WinRE is on.
  3. To view the info about the current WinRE recovery parition run
  4. To show the current status of the WinRE run
    • reagentc /info
  5. To disable the WinRE, run
    • reagentc /disable
  6. Create a new recovery partition.
    First, check if the disk partition style is a GUID Partition Table (GPT) or a Master Boot Record (MBR). To do that, run list disk. Check if there is an asterisk character (*) in the “Gpt” column. If there is an asterisk character (*), then the drive is GPT. Otherwise, the drive is MBR.
     
    1. If your disk is GPT, run (within diskpart)
      • create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
      • gpt attributes =0x8000000000000001 
    2. If your disk is MBR, run (within diskpart)
      • create partition primary id=27
    3. To format the partition, run (within diskpart)
      • format quick fs=ntfs label=”Windows RE tools”
    4. If your disk is MBR, run (within diskpart)
      • set id=27
  7. To confirm that the WinRE partition is created, run
    • list vol
  8. Then exit from diskpart.
  9. To re-enable WinRE, run
    • reagentc /enable
  10. To confirm the info of the (newly created) WinRE parition run
    • reagentc /info