Update write-motd.ps1

This commit is contained in:
Markus Fleschutz 2022-05-09 08:33:53 +02:00 committed by GitHub
parent f1682f3604
commit 2eb776610a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,9 @@ $OSName = "$((Get-WmiObject win32_operatingsystem).caption) Build: $([System.Env
$Kernel = "NT" # todo $Kernel = "NT" # todo
$Kernel_Info = "" # todo $Kernel_Info = "" # todo
$Uptime = 'S' + $(net statistics workstation | find "Statistics since").Substring(12).Trim(); $BootTime = Get-WinEvent -ProviderName eventlog | Where-Object {$_.Id -eq 6005} | Select-Object TimeCreated -First 1
$TimeSpan = (Get-Date) - $BootTime
$Uptime = $TimeSpan.Days + " days " + $TimeSpan.Hours + " hours " + $TimeSpan.Minutes + " minutes"
$PowerShellVersion = $PSVersionTable.PSVersion $PowerShellVersion = $PSVersionTable.PSVersion
$PowerShellEdition = $PSVersionTable.PSEdition $PowerShellEdition = $PSVersionTable.PSEdition