/legacy-hyper-v-gallery

Sample code for creating a custom Quick Create gallery for Hyper-V

Primary LanguagePowerShell

custom quick create gallery for hyper-v

background

see my blog post

distros

  • q4os trinity
  • oracle linux 8
  • solus budgie
  • arch
  • ghostbsd 19.04
  • devuan ascii
  • fedora silverblue 30
  • pop_os!
  • scientific linux 7

installing the gallery

tl;dr: open powershell as admin and run

$newValue = New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\"  `
    -Name 'GalleryLocations' -PropertyType MultiString -Value (
    'https://raw.githubusercontent.com/sirredbeard/hyper-v-gallery/master/gallery.json',
    'https://go.microsoft.com/fwlink/?linkid=851584')
$newValue.multistring

This adds the custom json from this repo alongside the existing Microsoft json in place.

use included powershell script

  1. download add_gallery.ps1
  2. if you have not done so already, enable powershell scripts by opening powershell as admin and running: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser (answer yes)
  3. make sure you are admin then cd to the folder with add_gallery.ps1 and run it: .\add_gallery.ps1

removing gallery

use powershell script

  1. download rm_gallery.ps1
  2. if you have not done so already, enable powershell scripts by opening powershell as admin and running: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser (answer yes)
  3. make sure you are admin then cd to the folder with rm_gallery.ps1 and run it: .\add_gallery.ps1

notes

this project was inspired by the following: