- <#
- .SYNOPSIS
- This script demonstrates setting default values for Local Hyper-V host.
- .DESCRIPTION
- This script imports the Hyper-V module then uses it
- to set certain default values for this hyper-V Host
- .NOTES
- File Name : Set-HyperVHostDefault.ps1
- Author : Thomas Lee - tfl@psp.co.uk
- Requires : PowerShell Version 3.0 and Windows 8/Server 2012
- .LINK
- This script posted to:
- http://www.pshscripts.blogspot.com
- .EXAMPLE
- Left as an exercise for the reader
- #>
- # Import Hyper-V Module
- Import-Module Hyper-V
- Write-Verbose "$((gcm -module hyper-v).Count) cmdlets imported in Hyper-V Module"
- # Create $parm hash table!
- $parm = @{}
- # Specify the Computername
- $parm += @{ComputerName = "Win8.Cookham.Net"}
- # Specify the Hard Disk Path
- $parm += @{VirtualMachinePath = "E:\hyperv"}
- # Specify the VHD Disk Path
- $parm += @{VirtualHardDiskPath = "E:\hyperv"}
- # Set the VM host accordingly
- Write-Verbose "Setting parameters as follows:";$parm
- Set-VmHost @parm
- # And Display Details
- Get-VMHost
- # End Set-HyperVHostDefaults
This blog contains PowerShell scripts, more PowerShell scripts and still more PowerShell scripts. Occasionally you may see some organisational posts.
Sunday, 16 September 2012
Set-HyperVHostDefault.ps1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment