-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvmware.ps1
More file actions
48 lines (48 loc) · 1.53 KB
/
Copy pathvmware.ps1
File metadata and controls
48 lines (48 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function Get-Fnic {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true)]
$Name
)
process {
try {
$xcli = Get-EsxCli -VMHost $Name -ErrorAction Stop
} catch {
Write-Warning "Could not connect EsxCli to $Name"
break
}
$output = $xcli.software.vib.list()
$outData = @{
'Host' = $Name;
'Version' = $output.Where{$_.Name -like "scsi-fnic"}.Version;
'ID' = $output.Where{$_.Name -like "scsi-fnic"}.ID;
}
Write-Output (New-Object -TypeName psobject -Property $OutData)
}
}
function Get-Enic {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true)]
$Name
)
process {
try {
$xcli = Get-EsxCli -VMHost $Name -ErrorAction Stop
} catch {
Write-Warning "Could not connect EsxCli to $Name"
break
}
foreach ($nic in ($xcli.network.nic.list()).Name) {
$outData = @{
'Host' = $Name;
'Driver' = ($xcli.network.nic.get($nic).DriverInfo).Driver;
'FirmwareVersion' = ($xcli.network.nic.get($nic).DriverInfo).FirmwareVersion;
'Version' = ($xcli.network.nic.get($nic).DriverInfo).Version;
}
Write-Output (New-Object -TypeName psobject -Property $OutData)
}
}
}