(plugin) apps::microsoft::hyperv::2012 - try to load Hyper-V module if needed (#3525)
This commit is contained in:
parent
6251df7892
commit
a2e65c1592
|
@ -40,6 +40,10 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
If (@(Get-Module | Where-Object {$_.Name -Match "Hyper-V"} ).count -eq 0) {
|
||||||
|
Import-Module -Name "Hyper-V"
|
||||||
|
}
|
||||||
|
|
||||||
$vms = Get-VM
|
$vms = Get-VM
|
||||||
|
|
||||||
$items = New-Object System.Collections.Generic.List[Hashtable];
|
$items = New-Object System.Collections.Generic.List[Hashtable];
|
||||||
|
|
|
@ -40,6 +40,9 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
If (@(Get-Module | Where-Object {$_.Name -Match "Hyper-V"} ).count -eq 0) {
|
||||||
|
Import-Module -Name "Hyper-V"
|
||||||
|
}
|
||||||
|
|
||||||
$vms = Get-VM
|
$vms = Get-VM
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,10 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
If (@(Get-Module | Where-Object {$_.Name -Match "Hyper-V"} ).count -eq 0) {
|
||||||
|
Import-Module -Name "Hyper-V"
|
||||||
|
}
|
||||||
|
|
||||||
$vms = Get-VMReplication
|
$vms = Get-VMReplication
|
||||||
|
|
||||||
$items = New-Object System.Collections.Generic.List[Hashtable];
|
$items = New-Object System.Collections.Generic.List[Hashtable];
|
||||||
|
|
|
@ -40,6 +40,10 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
If (@(Get-Module | Where-Object {$_.Name -Match "Hyper-V"} ).count -eq 0) {
|
||||||
|
Import-Module -Name "Hyper-V"
|
||||||
|
}
|
||||||
|
|
||||||
$vms = Get-VM
|
$vms = Get-VM
|
||||||
if ($vms.Length -gt 0) {
|
if ($vms.Length -gt 0) {
|
||||||
$snapshots = Get-VMSnapshot -VMName *
|
$snapshots = Get-VMSnapshot -VMName *
|
||||||
|
|
|
@ -40,6 +40,10 @@ $ProgressPreference = "SilentlyContinue"
|
||||||
|
|
||||||
Try {
|
Try {
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
If (@(Get-Module | Where-Object {$_.Name -Match "Hyper-V"} ).count -eq 0) {
|
||||||
|
Import-Module -Name "Hyper-V"
|
||||||
|
}
|
||||||
|
|
||||||
$vms = Get-VM
|
$vms = Get-VM
|
||||||
|
|
||||||
$node_is_clustered = 0
|
$node_is_clustered = 0
|
||||||
|
|
Loading…
Reference in New Issue