コロナに負けず、できることを少しずつ。

[ICT] Client Hyper-Vを有効後は PowerShell で遊ぼう (導入確認から)

NO IMAGE

[ICT] Client Hyper-V後は PowerShell で遊ぼう(導入確認から)

GUI 操作がなかなか難しい Windows 8.1 環境。そこでシェルを使って遊びましょう。

[amazon_enhanced asin=”477415542X” container=”” container_class=”” price=”All” background_color=”FFFFFF” link_color=”000000″ text_color=”0000FF” /]  [amazon_enhanced asin=”4873113822″ container=”” container_class=”” price=”All” background_color=”FFFFFF” link_color=”000000″ text_color=”0000FF” /]  [amazon_enhanced asin=”4891006137″ container=”” container_class=”” price=”All” background_color=”FFFFFF” link_color=”000000″ text_color=”0000FF” /]  [amazon_enhanced asin=”4797350180″ container=”” container_class=”” price=”All” background_color=”FFFFFF” link_color=”000000″ text_color=”0000FF” /]

■PowerShell を呼び出すには、アプリ検索「Power」が便利ですね!

PowerShell

 

===

■Client Hyper-V が有効であるとき

PS> Import-Module Hyper-V

これで Hyper-V モジュールのコマンドレットが PowerShell に追加される。

■使用可能なコマンドレット一覧を出力

PS > Get-Command -Module Hyper-V

使用可能なコマンド一覧を得られます。

■ちょっと長いけど、大事な確認なので付き合ってください。

パッと見、Add, Checkpoint, Compare, Complete, Connect, Convert, Copy, Debug, Disable, Disconnect, Dismount などのコマンドレット接頭値が目に飛び込んでくるので、これだけで目的が概ね間違いではないように見える。うん、大丈夫でしょう。

CommandType Name ModuleName

———– —- ———-
Cmdlet Add-VMDvdDrive Hyper-V
Cmdlet Add-VMFibreChannelHba Hyper-V
Cmdlet Add-VMHardDiskDrive Hyper-V
Cmdlet Add-VMMigrationNetwork Hyper-V
Cmdlet Add-VMNetworkAdapter Hyper-V
Cmdlet Add-VMNetworkAdapterAcl Hyper-V
Cmdlet Add-VMNetworkAdapterExtendedAcl Hyper-V
Cmdlet Add-VmNetworkAdapterRoutingDomainMapping Hyper-V
Cmdlet Add-VMRemoteFx3dVideoAdapter Hyper-V
Cmdlet Add-VMScsiController Hyper-V
Cmdlet Add-VMStoragePath Hyper-V
Cmdlet Add-VMSwitch Hyper-V
Cmdlet Add-VMSwitchExtensionPortFeature Hyper-V
Cmdlet Add-VMSwitchExtensionSwitchFeature Hyper-V
Cmdlet Checkpoint-VM Hyper-V
Cmdlet Compare-VM Hyper-V
Cmdlet Complete-VMFailover Hyper-V
Cmdlet Connect-VMNetworkAdapter Hyper-V
Cmdlet Connect-VMSan Hyper-V
Cmdlet Convert-VHD Hyper-V
Cmdlet Copy-VMFile Hyper-V
Cmdlet Debug-VM Hyper-V
Cmdlet Disable-VMEventing Hyper-V
Cmdlet Disable-VMIntegrationService Hyper-V
Cmdlet Disable-VMMigration Hyper-V
Cmdlet Disable-VMRemoteFXPhysicalVideoAdapter Hyper-V
Cmdlet Disable-VMResourceMetering Hyper-V
Cmdlet Disable-VMSwitchExtension Hyper-V
Cmdlet Disconnect-VMNetworkAdapter Hyper-V
Cmdlet Disconnect-VMSan Hyper-V
Cmdlet Dismount-VHD Hyper-V
Cmdlet Enable-VMEventing Hyper-V
Cmdlet Enable-VMIntegrationService Hyper-V
Cmdlet Enable-VMMigration Hyper-V
Cmdlet Enable-VMRemoteFXPhysicalVideoAdapter Hyper-V
Cmdlet Enable-VMReplication Hyper-V
Cmdlet Enable-VMResourceMetering Hyper-V
Cmdlet Enable-VMSwitchExtension Hyper-V
Cmdlet Export-VM Hyper-V
Cmdlet Export-VMSnapshot Hyper-V
Cmdlet Get-VHD Hyper-V
Cmdlet Get-VM Hyper-V
Cmdlet Get-VMBios Hyper-V
Cmdlet Get-VMComPort Hyper-V
Cmdlet Get-VMConnectAccess Hyper-V
Cmdlet Get-VMDvdDrive Hyper-V
Cmdlet Get-VMFibreChannelHba Hyper-V
Cmdlet Get-VMFirmware Hyper-V
Cmdlet Get-VMFloppyDiskDrive Hyper-V
Cmdlet Get-VMHardDiskDrive Hyper-V
Cmdlet Get-VMHost Hyper-V
Cmdlet Get-VMHostNumaNode Hyper-V
Cmdlet Get-VMHostNumaNodeStatus Hyper-V
Cmdlet Get-VMIdeController Hyper-V
Cmdlet Get-VMIntegrationService Hyper-V
Cmdlet Get-VMMemory Hyper-V
Cmdlet Get-VMMigrationNetwork Hyper-V
Cmdlet Get-VMNetworkAdapter Hyper-V
Cmdlet Get-VMNetworkAdapterAcl Hyper-V
Cmdlet Get-VMNetworkAdapterExtendedAcl Hyper-V
Cmdlet Get-VMNetworkAdapterFailoverConfiguration Hyper-V
Cmdlet Get-VmNetworkAdapterIsolation Hyper-V
Cmdlet Get-VMNetworkAdapterRoutingDomainMapping Hyper-V
Cmdlet Get-VMNetworkAdapterVlan Hyper-V
Cmdlet Get-VMProcessor Hyper-V
Cmdlet Get-VMRemoteFx3dVideoAdapter Hyper-V
Cmdlet Get-VMRemoteFXPhysicalVideoAdapter Hyper-V
Cmdlet Get-VMReplication Hyper-V
Cmdlet Get-VMReplicationAuthorizationEntry Hyper-V
Cmdlet Get-VMReplicationServer Hyper-V
Cmdlet Get-VMResourcePool Hyper-V
Cmdlet Get-VMSan Hyper-V
Cmdlet Get-VMScsiController Hyper-V
Cmdlet Get-VMSnapshot Hyper-V
Cmdlet Get-VMStoragePath Hyper-V
Cmdlet Get-VMSwitch Hyper-V
Cmdlet Get-VMSwitchExtension Hyper-V
Cmdlet Get-VMSwitchExtensionPortData Hyper-V
Cmdlet Get-VMSwitchExtensionPortFeature Hyper-V
Cmdlet Get-VMSwitchExtensionSwitchData Hyper-V
Cmdlet Get-VMSwitchExtensionSwitchFeature Hyper-V
Cmdlet Get-VMSystemSwitchExtension Hyper-V
Cmdlet Get-VMSystemSwitchExtensionPortFeature Hyper-V
Cmdlet Get-VMSystemSwitchExtensionSwitchFeature Hyper-V
Cmdlet Grant-VMConnectAccess Hyper-V
Cmdlet Import-VM Hyper-V
Cmdlet Import-VMInitialReplication Hyper-V
Cmdlet Measure-VM Hyper-V
Cmdlet Measure-VMReplication Hyper-V
Cmdlet Measure-VMResourcePool Hyper-V
Cmdlet Merge-VHD Hyper-V
Cmdlet Mount-VHD Hyper-V
Cmdlet Move-VM Hyper-V
Cmdlet Move-VMStorage Hyper-V
Cmdlet New-VFD Hyper-V
Cmdlet New-VHD Hyper-V
Cmdlet New-VM Hyper-V
Cmdlet New-VMReplicationAuthorizationEntry Hyper-V
Cmdlet New-VMResourcePool Hyper-V
Cmdlet New-VMSan Hyper-V
Cmdlet New-VMSwitch Hyper-V
Cmdlet Optimize-VHD Hyper-V
Cmdlet Remove-VM Hyper-V
Cmdlet Remove-VMDvdDrive Hyper-V
Cmdlet Remove-VMFibreChannelHba Hyper-V
Cmdlet Remove-VMHardDiskDrive Hyper-V
Cmdlet Remove-VMMigrationNetwork Hyper-V
Cmdlet Remove-VMNetworkAdapter Hyper-V
Cmdlet Remove-VMNetworkAdapterAcl Hyper-V
Cmdlet Remove-VMNetworkAdapterExtendedAcl Hyper-V
Cmdlet Remove-VMNetworkAdapterRoutingDomainMapping Hyper-V
Cmdlet Remove-VMRemoteFx3dVideoAdapter Hyper-V
Cmdlet Remove-VMReplication Hyper-V
Cmdlet Remove-VMReplicationAuthorizationEntry Hyper-V
Cmdlet Remove-VMResourcePool Hyper-V
Cmdlet Remove-VMSan Hyper-V
Cmdlet Remove-VMSavedState Hyper-V
Cmdlet Remove-VMScsiController Hyper-V
Cmdlet Remove-VMSnapshot Hyper-V
Cmdlet Remove-VMStoragePath Hyper-V
Cmdlet Remove-VMSwitch Hyper-V
Cmdlet Remove-VMSwitchExtensionPortFeature Hyper-V
Cmdlet Remove-VMSwitchExtensionSwitchFeature Hyper-V
Cmdlet Rename-VM Hyper-V
Cmdlet Rename-VMNetworkAdapter Hyper-V
Cmdlet Rename-VMResourcePool Hyper-V
Cmdlet Rename-VMSan Hyper-V
Cmdlet Rename-VMSnapshot Hyper-V
Cmdlet Rename-VMSwitch Hyper-V
Cmdlet Repair-VM Hyper-V
Cmdlet Reset-VMReplicationStatistics Hyper-V
Cmdlet Reset-VMResourceMetering Hyper-V
Cmdlet Resize-VHD Hyper-V
Cmdlet Restart-VM Hyper-V
Cmdlet Restore-VMSnapshot Hyper-V
Cmdlet Resume-VM Hyper-V
Cmdlet Resume-VMReplication Hyper-V
Cmdlet Revoke-VMConnectAccess Hyper-V
Cmdlet Save-VM Hyper-V
Cmdlet Set-VHD Hyper-V
Cmdlet Set-VM Hyper-V
Cmdlet Set-VMBios Hyper-V
Cmdlet Set-VMComPort Hyper-V
Cmdlet Set-VMDvdDrive Hyper-V
Cmdlet Set-VMFibreChannelHba Hyper-V
Cmdlet Set-VMFirmware Hyper-V
Cmdlet Set-VMFloppyDiskDrive Hyper-V
Cmdlet Set-VMHardDiskDrive Hyper-V
Cmdlet Set-VMHost Hyper-V
Cmdlet Set-VMMemory Hyper-V
Cmdlet Set-VMMigrationNetwork Hyper-V
Cmdlet Set-VMNetworkAdapter Hyper-V
Cmdlet Set-VMNetworkAdapterFailoverConfiguration Hyper-V
Cmdlet Set-VmNetworkAdapterIsolation Hyper-V
Cmdlet Set-VmNetworkAdapterRoutingDomainMapping Hyper-V
Cmdlet Set-VMNetworkAdapterVlan Hyper-V
Cmdlet Set-VMProcessor Hyper-V
Cmdlet Set-VMRemoteFx3dVideoAdapter Hyper-V
Cmdlet Set-VMReplication Hyper-V
Cmdlet Set-VMReplicationAuthorizationEntry Hyper-V
Cmdlet Set-VMReplicationServer Hyper-V
Cmdlet Set-VMResourcePool Hyper-V
Cmdlet Set-VMSan Hyper-V
Cmdlet Set-VMSwitch Hyper-V
Cmdlet Set-VMSwitchExtensionPortFeature Hyper-V
Cmdlet Set-VMSwitchExtensionSwitchFeature Hyper-V
Cmdlet Start-VM Hyper-V
Cmdlet Start-VMFailover Hyper-V
Cmdlet Start-VMInitialReplication Hyper-V
Cmdlet Stop-VM Hyper-V
Cmdlet Stop-VMFailover Hyper-V
Cmdlet Stop-VMInitialReplication Hyper-V
Cmdlet Stop-VMReplication Hyper-V
Cmdlet Suspend-VM Hyper-V
Cmdlet Suspend-VMReplication Hyper-V
Cmdlet Test-VHD Hyper-V
Cmdlet Test-VMNetworkAdapter Hyper-V
Cmdlet Test-VMReplicationConnection Hyper-V

■実際にVM作成に必要なリソース割り当てから、イメージを充て込んで VM起動するまでのスクリプトは次回確認します。

以上

Client Hyper-Vカテゴリの最新記事