Merge pull request #8090 from DanHam/fix-psh-formatting
Fix powershell formatting. Match style for conditionals
This commit is contained in:
commit
0e963f5017
|
@ -38,18 +38,16 @@ if ($HostVMAdapter){
|
||||||
if ($HostNetAdapter){
|
if ($HostNetAdapter){
|
||||||
$HostNetAdapterIfIndex = @()
|
$HostNetAdapterIfIndex = @()
|
||||||
$HostNetAdapterIfIndex += $HostNetAdapter.ifIndex
|
$HostNetAdapterIfIndex += $HostNetAdapter.ifIndex
|
||||||
$HostNetAdapterConfiguration = @(get-wmiobject win32_networkadapterconfiguration -filter "IPEnabled = 'TRUE'") | Where-Object { $HostNetAdapterIfIndex.Contains($_.InterfaceIndex) }
|
$HostNetAdapterConfiguration = @(get-wmiobject win32_networkadapterconfiguration -filter "IPEnabled = 'TRUE'") | Where-Object { $HostNetAdapterIfIndex.Contains($_.InterfaceIndex)
|
||||||
if ($HostNetAdapterConfiguration){
|
if ($HostNetAdapterConfiguration){
|
||||||
return @($HostNetAdapterConfiguration.IpAddress)[$addressIndex]
|
return @($HostNetAdapterConfiguration.IpAddress)[$addressIndex]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$HostNetAdapterConfiguration=@(Get-NetIPAddress -CimSession $env:computername -AddressFamily IPv4 | Where-Object { ( $_.InterfaceAlias -notmatch 'Loopback' ) -and ( $_.SuffixOrigin -notmatch "Link" )})
|
$HostNetAdapterConfiguration=@(Get-NetIPAddress -CimSession $env:computername -AddressFamily IPv4 | Where-Object { ( $_.InterfaceAlias -notmatch 'Loopback' ) -and ( $_.SuffixOrigin -notmatch "Link" )})
|
||||||
if ($HostNetAdapterConfiguration) {
|
if ($HostNetAdapterConfiguration) {
|
||||||
return @($HostNetAdapterConfiguration.IpAddress)[$addressIndex]
|
return @($HostNetAdapterConfiguration.IpAddress)[$addressIndex]
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue