컴퓨터가 얼마동안 켜져 있는지를 확인하는 방법


====

$os = Get-WmiObject -Class Win32_OperatingSystem
$boottime =
[System.Management.ManagementDateTimeConverter]::
ToDateTime($os.LastBootupTime)
$timedifference = New-TimeSpan -Start $boottime
$days = $timedifference.TotalDays
‘Your system is running for {0:0.0} days.’ -f $days
=====

위의 내용을 .ps1 파일로 만들어 실행하면 알 수 있다.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s