{"id":20566813,"url":"https://github.com/tomaustin700/hyperdeploy","last_synced_at":"2026-03-13T20:36:45.845Z","repository":{"id":38084833,"uuid":"291676854","full_name":"tomaustin700/HyperDeploy","owner":"tomaustin700","description":"Powershell module to deploy and manage Hyper V VM's using Infrastructure as Code","archived":false,"fork":false,"pushed_at":"2024-07-10T07:10:50.000Z","size":118,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T16:00:32.117Z","etag":null,"topics":["hacktoberfest","hyper-v","infrastructure-as-code","powershell-module"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomaustin700.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-08-31T09:49:49.000Z","updated_at":"2025-01-15T14:35:15.000Z","dependencies_parsed_at":"2025-04-14T15:53:55.440Z","dependency_job_id":"76dc5183-aa39-49fd-906c-c667f9c701b3","html_url":"https://github.com/tomaustin700/HyperDeploy","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tomaustin700/HyperDeploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaustin700%2FHyperDeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaustin700%2FHyperDeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaustin700%2FHyperDeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaustin700%2FHyperDeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomaustin700","download_url":"https://codeload.github.com/tomaustin700/HyperDeploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomaustin700%2FHyperDeploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30474935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T17:15:31.527Z","status":"ssl_error","status_checked_at":"2026-03-13T17:15:22.394Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","hyper-v","infrastructure-as-code","powershell-module"],"created_at":"2024-11-16T04:43:45.469Z","updated_at":"2026-03-13T20:36:45.819Z","avatar_url":"https://github.com/tomaustin700.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HyperDeploy\n\n## Introduction\nHyperDeploy is a Powershell module that allows the use of infrastructure as code (IaC) to create and provision Hyper-V virtual machines.\n\n## Installation\nHyperDeploy is not currently cross-platform and will only run on Windows, it can be installed by running the following command:\n```powershell\nInstall-Module -Name HyperDeploy\n```\n\n# Usage\n\nThe main function provided by HyperDeploy is `Publish-HyperDeploy` which has the following parameters:\n\n### Definition File\n\n```powershell\nPublish-HyperDeploy -DefinitionFile \"C:\\definition.json\"\n```\nThe definition file is a json file that instructs Hyper Deploy on the infrastructure changes that you want, it is the code part of infrastructure as code. More information on the definition file can be found below.\n\n### Replace\n```powershell\nPublish-HyperDeploy -DefinitionFile \"C:\\definition.json\" -Replace\n```\nIf replace is specified then Hyper Deploy will replace any Hyper-V VM's that already exist when `Publish-HyperDeploy` is ran.\n\n### Force\n```powershell\nPublish-HyperDeploy -DefinitionFile \"C:\\definition.json\" -Force\n```\nForce will prevent Hyper Deploy prompting for confirmation before carrying out actions, use with care!\n\n### Destroy\n```powershell\nPublish-HyperDeploy -DefinitionFile \"C:\\definition.json\" -Destroy\n```\nDestroy will remove all infrastructure specified in the definition file, use with care!\n\n### ReplaceUpFront\n```powershell\nPublish-HyperDeploy -DefinitionFile \"C:\\definition.json\" -Replace -ReplaceUpFront\n```\nIf replace is set then remove all VM's specified within the definition file in one go before replacing. If not set HyperDeploy will remove and replace one-by-one.\n\n### ContinueOnError\n```powershell\nPublish-HyperDeploy -DefinitionFile \"C:\\definition.json\" -ContinueOnError\n```\nStops HyperDeploy from aborting if an issue is encountered during execution.\n\n# Definition File\n\nExample definition file:\n```json\n{\n    \"DeploymentOptions\": {\n        \"StartAfterCreation\": true,\n        \"Parallel\": false\n    },\n    \"VMs\": [\n        {\n            \"Name\": \"VM\",\n            \"ProcessorCount\": 8,\n            \"MemoryStartupBytes\": \"1GB\",\n            \"MemoryMaximumBytes\": \"4GB\",\n            \"CheckpointType\": \"Disabled\",\n            \"Replicas\": 50,\n            \"ReplicaStartIndex\" : 5,\n            \"SkipNames\": [\n                \"VM10\"\n            ],\n            \"HyperVServers\": [\n                {\n                    \"Name\": \"Host1\",\n                    \"SwitchName\": \"VM Virtual Switch\",\n                    \"GoldenImagePath\": \"A:\\\\goldenimage.vhdx\",\n                    \"VMHardDiskPath\": \"A:\\\\Virtual Hard Disks\"\n                },\n                {\n                    \"Name\": \"Host2\",\n                    \"SwitchName\": \"VM Virtual Switch\",\n                    \"GoldenImagePath\": \"A:\\\\goldenimage.vhdx\",\n                    \"VMHardDiskPath\": \"A:\\\\Virtual Hard Disks\",\n                    \"MaxReplicas\" : 20\n                }\n            ],\n            \"PostCreate\":{\n                \"Scripts\":[\n                    \"C:\\\\HyperDeployScripts\\\\SetVLANS.ps1\"\n                ]\n            },\n            \"Provisioning\": {\n                \"RebootAfterEachScript\": true,\n                \"RebootAfterLastScript\": true,\n                \"RebuildOnValidationFailure\": true,\n                \"RebuildOnProvisionFailure\": true,\n                \"Scripts\": [\n                    \"C:\\\\HyperDeployScripts\\\\Script1.Set-Credential.ps1\",\n                    \"C:\\\\HyperDeployScripts\\\\Script2.ps1\"\n                ]\n            }\n        }\n    ]\n}\n```\n\n## Deployment Options\n```json\n\"DeploymentOptions\": {\n        \"StartAfterCreation\": true,\n        \"Parallel\": false\n    }\n```\nDeployment options are global settings which rule over all deployments.\n### **StartAfterCreation**\nIf set to true HyperDeploy will start a VM immediately after the VM has been created. This must be set to true to use the provisioning features of HyperDeploy (discussed below)\n\n### **Parallel**\nIf set to true HyperDeploy will attempt to create VM's and provision in parallel to speed up deployment. Up to 5 VM's will be created/provisioned in parallel. This is an experamental feature and has not been thoroughly tested so use with care.\n\n## VMs\nVMS is an array of virtual machines that you want to create/destroy using HyperDeploy. See below for an explanation of options that can be set on each VM.\n\n## VM Settings\n```json\n{\n            \"Name\": \"VM\",\n            \"ProcessorCount\": 8,\n            \"MemoryStartupBytes\": \"1GB\",\n            \"MemoryMaximumBytes\": \"4GB\",\n            \"CheckpointType\": \"Disabled\",\n            \"Replicas\": 50,\n            \"ReplicaStartIndex\" : 5,\n            \"SkipNames\": [\n                \"VM10\"\n            ],\n            \"HyperVServers\": [\n                {\n                    \"Name\": \"Host1\",\n                    \"SwitchName\": \"VM Virtual Switch\",\n                    \"GoldenImagePath\": \"A:\\\\goldenimage.vhdx\",\n                    \"VMHardDiskPath\": \"A:\\\\Virtual Hard Disks\"\n                },\n                {\n                    \"Name\": \"Host2\",\n                    \"SwitchName\": \"VM Virtual Switch\",\n                    \"GoldenImagePath\": \"A:\\\\goldenimage.vhdx\",\n                    \"VMHardDiskPath\": \"A:\\\\Virtual Hard Disks\",\n                    \"MaxReplicas\" : 20\n                }\n            ],\n            \"PostCreate\":{\n                \"Scripts\":[\n                    \"C:\\\\HyperDeployScripts\\\\SetVLANS.ps1\"\n                ]\n            },\n            \"Provisioning\": {\n                \"RebootAfterEachScript\": true,\n                \"RebootAfterLastScript\": true,\n                \"RebuildOnValidationFailure\": true,\n                \"RebuildOnProvisionFailure\": true,\n                \"Scripts\": [\n                    \"C:\\\\HyperDeployScripts\\\\Script1.Set-Credential.ps1\",\n                    \"C:\\\\HyperDeployScripts\\\\Script2.ps1\"\n                ]\n            }\n        }\n\n```\n\n### **Name**\nName of VM you want to create/destroy using HyperDeploy, if `Replicas` is also specified then a number will be suffixed onto the name for each replica created.\n\n### **ProcessorCount**\nSpecifies how many virtual processors the VM should be created with.\n\n### **MemoryStartupBytes**\nSpecifies how much memory the VM should be assigned at startup.\n\n### **MemoryMaximumBytes**\nSpecifies the maximum memory that can be assigned to the VM.\n\n### **CheckpointType**\nAllows setting the VMs checkpoint setting within Hyper-V, for options see below:\n\nThe acceptable values for this parameter are:\n\nDisabled. Block creation of checkpoints.\n\nStandard. Create standard checkpoints.\n\nProduction. Create production checkpoints if supported by guest operating system. Otherwise, create standard checkpoints.\n\nProductionOnly. Create production checkpoints if supported by guest operating system. Otherwise, the operation fails.\n\n### **Replicas**\nIf set HyperDeploy will create replicas of the VM, this is useful when you have a golden image and want to deploy x amount of replicas. For each replica a number will be suffixed onto the name value. Replicas will be load balanced accross the hosts specified in the `HyperVServers` array (see below).\n\n### **ReplicaStartIndex**\nUsed in conjunction with `Replicas`, dictates what the starting replica number should be.\n\n### **SkipNames**\nUse this array to specify any VM's you want to be skipped over when creating replicas. For example if `Name` is set to `VM` and  `Replicas` is set to 3 the following VMs would be created: VM1, VM2 and VM3. If `SkipNames` has `VM2` specified in it like so:\n```json\n\"SkipNames\": [\n                \"VM2\"\n            ],\n```\nThe VMs created would be VM`, VM3 and VM4.\n\n### **HyperVServers**\nThis array contains the details about each Hyper-V host you want to deploy VM's to.\n```json\n\"HyperVServers\": [\n                {\n                    \"Name\": \"Host1\",\n                    \"SwitchName\": \"VM Virtual Switch\",\n                    \"GoldenImagePath\": \"A:\\\\goldenimage.vhdx\",\n                    \"VMHardDiskPath\": \"A:\\\\Virtual Hard Disks\",\n                    \"MaxReplicas\" : 20\n                }\n            ]\n```\n#### **Name**\nName of the Hyper-V host you want to deploy VM's to. The host much have WinRM enabled and allow remote connections.\n\n#### **SwitchName** \nName of the Hyper-V Virtual Switch you want to assign to the VM\n\n#### **GoldenImagePath**\nUsed in conjuction with VM Replica setting. If specified a copy of the golden image specified will be taken and attached as a virtual hard disk to the VM\n\n#### **VMHardDiskPath**\nLocation where you want to store the VM hard disk on the host server.\n\n#### **MaxReplicas**\nMaximum amount on replicas to assign to the host if `Replicas` are in use.\n\n### **PostCreate**\nPost create allows you to execute scripts against the created VM, the main use of these scripts is to set additional Hyper V configuration settings that HyperDeploy cannot do natively such as assign a VLAN Identifier or set VM Firmware configuration.\n```json\n\"PostCreate\":{\n                \"Scripts\":[\n                    \"C:\\\\HyperDeployScripts\\\\SetVLANS.ps1\"\n                ]\n            }\n```\nThe name of the created VM is passed as an argument to any specified scripts. An example Post Create script may look like the following:\n\n```powershell\nparam($name)\n\nSet-VMNetworkAdapterVlan -VMName $name -Access -VlanId 121\n```\n\n### **Provisioning**\nProvisioning allows you to execute Powershell scripts against VM's created by HyperDeploy during the creation process.\n```json\n\"Provisioning\": {\n                \"RebootAfterEachScript\": true,\n                \"RebootAfterLastScript\": true,\n                \"RebuildOnProvisionFailure\": true,\n                \"Scripts\": [\n                    \"C:\\\\HyperDeployScripts\\\\Script1.Set-Credential.ps1\",\n                    \"C:\\\\HyperDeployScripts\\\\Script2.ps1\"\n                ]\n            }\n```\n#### **RebootAfterEachScript**\nIf true after each script is ran the VM will be rebooted. Useful when your scripts require a reboot to apply such as joining a domain.\n\n#### **RebootAfterLastScript**\nIf true will reboot after the last provisioning script is ran, default value is `true`\n\n#### **RebuildOnProvisionFailure**\nIf true will recreate the VM if any error is detected as part of the priovisioning process, this will be retried up to 3 times.\n\n### **Scripts**\nArray of scripts you want to execute against the VM. These are executed over WinRM. In order for communication to be established over WinRM you need to set the credentials for HyperDeploy to use, this is done using credential scripts. Credential scripts end in .Set-Credential.ps1 and should return a `pscredential` object. See below for an example credential script\n```powershell\n[string]$userName = 'user'\n[string]$userPassword = 'password'\n[securestring]$secStringPassword = ConvertTo-SecureString $userPassword -AsPlainText -Force\n[pscredential]$credOject = New-Object System.Management.Automation.PSCredential ($userName, $secStringPassword)\n\nreturn $credOject\n```\nI would highly recommend you don't store credentials within a Powershell script and instead use something like a replace tokens task/script within a CI/CD system.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaustin700%2Fhyperdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomaustin700%2Fhyperdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomaustin700%2Fhyperdeploy/lists"}