This is a quick guide to backing up and restoring your ESXi host (based around ESXi 6.7) using PowerCLI
Backup
To backup your host’s configuration run:
Get-VMHostFirmware -VMHost 10.50.0.10 -BackupConfiguration -DestinationPath C:\ESXiBackups
Restore
To restore your host’s configuration, first install ESXi on the host, give it an IP then put it in maintenance mode:
Set-VMHost -VMHost 10.50.0.10 -State 'Maintenance'
Then restore the backup file to the host:
Set-VMHostFirmware -VMHost 10.50.0.10 -Restore -SourcePath C:\ESXiBackups\bundleToRestore.tgz -HostUser root -HostPassword yourrootpassword