Kamalasekar Parthasarathy
asked on
Powershell help
Hi all,
Can someone explains line by line...i know it just try to get the uptime but need explanation and i want to knw what it does...
Program:
$computer = read-host "Please type in computer name you would like to check uptime on"
$lastboottime = (Get-WmiObject -Class Win32_OperatingSystem -computername $computer).LastBootUpTime
$sysuptime = (Get-Date) – [System.Management.Managem entDateTim econverter ]::ToDateT ime($lastb oottime)
Write-Host "$computer has been up for: " $sysuptime.days "days" $sysuptime.hours "hours" $sysuptime.minutes "minutes" $sysuptime.seconds "seconds"
Can someone explains line by line...i know it just try to get the uptime but need explanation and i want to knw what it does...
Program:
$computer = read-host "Please type in computer name you would like to check uptime on"
$lastboottime = (Get-WmiObject -Class Win32_OperatingSystem -computername $computer).LastBootUpTime
$sysuptime = (Get-Date) – [System.Management.Managem
Write-Host "$computer has been up for: " $sysuptime.days "days" $sysuptime.hours "hours" $sysuptime.minutes "minutes" $sysuptime.seconds "seconds"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mn
q
ASKER