Skip to content

Commit 4142e92

Browse files
committed
Added extra check for PowerShell module Hyper-V
1 parent 5b55aea commit 4142e92

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

internal/functions/Test-PSDCHyperVEnabled.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,19 @@
8888
}
8989
elseif ($osDetails.Caption -like '*Windows Server*') {
9090
if ($computer.IsLocalhost) {
91-
$feature = Get-WindowsFeature -Name 'Hyper-V'
91+
$feature = Get-WindowsFeature -Name 'Hyper-V', 'Hyper-V-PowerShell'
9292
}
9393
else{
9494
$command = [scriptblock]::Create("Get-WindowsFeature -Name 'Hyper-V'")
9595
$feature = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $Credential
9696
}
9797

98-
return $feature.Installed
98+
if($feature.Installed -contains $false){
99+
return $false
100+
}
101+
else{
102+
return $true
103+
}
99104
}
100105

101106

0 commit comments

Comments
 (0)