Categories:
  🠪  General

Email
  🠪  Servers
  🠪  Testing
  🠪  Tips

Hardware
  🠪  3D Printing
  🠪  Apple
  🠪  Batteries
  🠪  Drives
  🠪  Edgerouter
  🠪  Electronics
  🠪  Laptop
  🠪  Modems
  🠪  Phone
  🠪  Printers
  🠪  Raspberry Pi
  🠪  Tablets
  🠪  Testing
  🠪  Virtualization

hidden
  🠪  General

Links
  🠪  Interesting
  🠪  Media

Network
  🠪  Data
  🠪  Testing
  🠪  VPN

Scripts
  🠪  Batch
  🠪  Linux
  🠪  Powershell

Servers
  🠪  Databases
  🠪  Misc
  🠪  Website

Software
  🠪  Other

Utilities
  🠪  Backup
  🠪  Fix Issues
  🠪  Recovery

Video
  🠪  Editing

Websites
  🠪  HTML
  🠪  Testing

Windows
  🠪  Adjustments
  🠪  Issues
  🠪  Remote Desktop
  🠪  Security
  🠪  Slow
  🠪  Software
  🠪  Startup

Submit Entry
Airin's Notes

Category: Scripts 🠪 Powershell
Create daily exports of Hyper-V Virtual Machines
December 1, 2023

$BackupPathBase = "Z:\Backups\Hyper-V"
$Date = Get-Date

#Details on command lines: https://www.nakivo.com/blog/hyper-v-export-import/



$VMList = Get-VM
foreach ( $VM in $VMList){

$BackupPath = "$($BackupPathBase)\$($Date.DayOfWeek)"

If( ! ( Test-Path -PathType container $BackupPath ) ){
New-Item -ItemType Directory -Force -Path $BackupPath
}

Write-Host "Backup up $($VM.Name) to $($BackupPath)"
Export-VM -Name $VM.Name -Path $BackupPath
}



keywords: VM, vmdx





This site is meant to be used as a reference for myself, although others may find it useful. I use it to keep track of certain fixes, software, and other solutions which I may need while assisting customers. The page layout is pure HTML/CSS and is kept simple to optimize loading time and fast results.

Return to Airin's Computers