ps/Modules/Alkami.DevOps.TeamCity/Public/Get-EC2WindowsDriverVersions.ps1

26 lines
1017 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Get-EC2WindowsDriverVersions {
<#
.SYNOPSIS
Get and display the versions of the AWS EC2 Windows Drivers that might need to be updated
#>
[CmdletBinding()]
[OutputType([System.Void])]
#TODO: ADD RetVal of Hashtable of DriverName:DriverVersion or something
# Where all the windows driver downloads come from
# https://s3.amazonaws.com/ec2-windows-drivers-downloads
$getPVDriverScriptBlock = {
Get-ItemProperty HKLM:\SOFTWARE\Amazon\PVDriver
}
$enaVersionInfoScriptBlock = {
(Get-ChildItem "C:\Windows\System32\drivers\ena.sys").VersionInfo
}
$nvmeVersionInfoScriptBlock = {
(Get-ChildItem "C:\Windows\System32\drivers\AWSNvme.sys").VersionInfo
}
$servers = Get-TeamCityHostnames
Invoke-Command -ComputerName $servers -ScriptBlock $getPVDriverScriptBlock
Invoke-Command -ComputerName $servers -ScriptBlock $enaVersionInfoScriptBlock
Invoke-Command -ComputerName $servers -ScriptBlock $nvmeVersionInfoScriptBlock
}