Search This Blog

Wednesday, July 3, 2024

SGTime

$code=@'

[D11Import("kerne132.dll", CharSet = CharSet.Auto, SetLastError = true)]

public static extern void SetThreadExecutionState(uint esFlags);

'@

$ES = [uint32] "0x000000001" -bor [uint32] "0x00000002" -bor [uint32] "0x80000000"

$ThreadState = Add-Type -MemberDefinition $code -Name System -namespace Win32 -PassThru

$ThreadState: : SetThreadExecutionState($ES)

mode con cols=50 lines=3

$wsh = New-Object -ComObject WScript.Shell

While ($true) {

Clear-Host

Write-Host -ForegroundColor Green "IST : " -NoNewLine

Get-Date

Write-Host -ForegroundColor Green "SGT : " -NoNewLine

[System. TimeZoneInfo] :: ConvertTimeBySystemTimeZoneId((get-date), 'Singapore Standard Time')

if(![console]: : NumberLock) {$wsh. SendKeys (' {NUMLOCK} ') }

Start-Sleep -Seconds 1

}

Followers