Dump Windows version information during cluster bringup.

pull/564/head
Peter Hornyack 2019-02-28 14:45:09 -08:00
parent 43556be50e
commit 18a2a98d67
2 changed files with 14 additions and 0 deletions

View File

@ -91,6 +91,7 @@ try {
# then put these calls into a loop over a list of XYZ-psm1 keys.
FetchAndImport-ModuleFromMetadata 'k8s-node-setup-psm1' 'k8s-node-setup.psm1'
Dump-DebugInfoToConsole
Set-PrerequisiteOptions
$kube_env = Fetch-KubeEnv
Disable-WindowsDefender

View File

@ -128,6 +128,19 @@ function Add_GceMetadataServerRoute {
}
}
# Writes debugging information, such as Windows version and patch info, to the
# console.
function Dump-DebugInfoToConsole {
Try {
$version = "$([System.Environment]::OSVersion.Version | Out-String)"
$hotfixes = "$(Get-Hotfix | Out-String)"
$image = "$(Get-InstanceMetadata 'image' | Out-String)"
Log-Output "Windows version:`n$version"
Log-Output "Installed hotfixes:`n$hotfixes"
Log-Output "GCE Windows image:`n$image"
} Catch { }
}
# Fetches the kube-env from the instance metadata.
#
# Returns: a PowerShell Hashtable object containing the key-value pairs from