Skip to content
Branch: master
Commits on Sep 16, 2019
  1. Remove-VirtualMachine now accepts an array

    alfredmyers committed Sep 16, 2019
    ... of virtual machine names instead of a single VM name.
  2. Changed default SecureBootTemplate to MicrosoftUEFICertificateTemplate

    alfredmyers committed Sep 16, 2019
    With previous version, when a Secure Boot template wasn't informed,
    the function defaulted to SecureBoot=Off and
    The logic behind that decision was that Secure Boot being off, the
    template wouldn't matter.
    While true, given the current usage of this module:
    1. There's no reason a "modern" Windows VM would turn off Secure
       Boot, so a Windows VM with SecureBoot=On and
       SecureBootTemplate=MicrosoftUEFICertificate Authority is simply
       something that doesn't happen.
    2. Way more VM instances are being created targeting Linux than
       Windows, so defaulting to MicrosoftUEFICertificateAuthority
       would allow us to later turn on Secure Boot on a Linux machine
       without having to change template as well.
Commits on Sep 10, 2019
Commits on Sep 8, 2019
  1. Merged all scripts into module

    alfredmyers committed Sep 8, 2019
    Merged Get-OrphanedVHDs.ps1, New-VirtualMachine.ps1 and Remove-VirtualMachine.ps1
     into Power-V.psm1
  2. Parameterized swtich name

    alfredmyers committed Sep 8, 2019
    Added a parameter to receive an optional switch name.
    If no switch name is provided, will try to find a single switch with
    external connectivity.
    If the number of switches with that characteric is other than one,
    then no switch will be chosen and the behaviour is undefined.
Commits on Sep 6, 2019
  1. Removed hardcoded switch name

    alfredmyers committed Sep 6, 2019
    Instead will get THE external switch whatever its name happens to be.
    I hope the script breaks if there's more than one external switch as
    that is not being accounted for.
    That's left as an exercise for future me.
Commits on Sep 5, 2019
  1. Added proper support for checkpoints/snapshots

    alfredmyers committed Sep 5, 2019
    The previous version of the script removed the snapshots of all virtual
    machines in the process of creating a list of files being used by those
    virtual machines, as I hadn't yet figured out how to link the VMs to any
    but the last snapshot.
    It was ugly but worked in a world where the only existing snapshots were
    there by "accident". It just happens that the default Hyper-V seetings
    turn on automatic checkpoints.
    The new version creates a list of VHDs linked to the VMs themselves plus
    VHDs linked to any snapshots that may exist.
  2. Fixed snapshot bug

    alfredmyers committed Sep 5, 2019
    Previous revision got the file name from the VM.
    If the VM had a snapshot, the name would point to a snapshot file.
    Later when the VM was removed, PowerShell automatically removed any
    existing snapshots merging them into the root VHD.
    Then the script tried to delete the file (snapshot) which the VM was
    pointing to which at this point didn't exist any more.
    As a result, the original (root) VHD was left behind untouched.
  3. Added support for SecureBoot and removed PXE

    alfredmyers committed Sep 5, 2019
    Added a new optional parameter for informing a Secure Boot template:
    For guest OSes that support Secure Boot the template can be specifed.
    For instance: MicrosoftUEFICertificateAuthority
    For guest OSes that don't support, the parameter should not be provided
    The network adapter was removed from Boot Order since I'm not yet using
    PXE. This should speed up the initial boot for installing the OS as the
    the firmware will jump from the harddrive directly to the DVD drive
    without having to timeout on the network adapter.
Commits on Aug 27, 2019
  1. Initial commit

    alfredmyers committed Aug 27, 2019
    ** Notes **
    Hyper-V's MMC snap-in defaults to creating automatic snapshots.
    The current version of the scripts contained here in aren't really all
    that prepared to deal correctly with snapshots/checkpoints, so New-Toy disables
    automatic checkpoints.
    And although Get-OrphanedVHDs and Remove-Toy contain code for removing
    snapshots, the code has shown to be flaky because of timing issues since
    snapshots seem to be merged asynchronously resulting in the following
    instructions being executed before the merge being done.
You can’t perform that action at this time.