How to update data in Google Sheets using apps script.

Опубликовано: 23 Июль 2026
на канале: Happy To Help You
168
1

Hi my name is Satyajit Chatterjee
Please subscribe
=============================================================

Ask to price please contact me on WhatsApp - 8617727504

====================================================================
Application Information

====================================================================
FOLLOW US ON SOCIAL
Instagram-  / happytohelpyou_satyajit  
Email- [email protected]
===================================================================
Tags
Happy to help you
satyajit chatterjee

#GoogleAppsScript
#DataAutomation
#CodingTutorial
#GoogleSheets
#AppScript
#TechTutorial
#Automation
#Programming
#ScriptCoding
#DataManagement

$computers = @("PC1", "PC2", "PC3")
$threshold = (Get-Date).AddDays(-15)

foreach ($computer in $computers) {
try {
$uptime = Invoke-Command -ComputerName $computer -ScriptBlock {
$os = Get-WmiObject win32_operatingsystem
$lastBootUpTime = $os.ConvertToDateTime($os.LastBootUpTime)
return $lastBootUpTime
}

if ($uptime -gt $threshold) {
Write-Host "$computer has been rebooted within the last 15 days. Last boot time: $uptime"
} else {
Write-Host "$computer has not been rebooted within the last 15 days. Last boot time: $uptime"
}
} catch {
Write-Host "Could not retrieve information from $computer. Error: $_"
}
}