mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-23 05:01:37 +01:00
Update some scripts
This commit is contained in:
parent
97cd42cb86
commit
3a5f2371e3
@ -20,6 +20,7 @@
|
||||
& "$PSScriptRoot/check-cpu.ps1"
|
||||
& "$PSScriptRoot/check-ram.ps1"
|
||||
& "$PSScriptRoot/check-gpu.ps1"
|
||||
& "$PSScriptRoot/check-bios.ps1"
|
||||
& "$PSScriptRoot/check-smart-devices.ps1"
|
||||
& "$PSScriptRoot/check-power.ps1"
|
||||
& "$PSScriptRoot/check-drives.ps1"
|
||||
|
@ -7,7 +7,6 @@
|
||||
PS> ./check-software.ps1
|
||||
|
||||
S O F T W A R E
|
||||
✅ BIOS model 'P62 v02.67' version HPQOEM - 0 by HP
|
||||
✅ Windows 10 Pro 64-Bit (v10.0.19045, since 5/2/2021)
|
||||
...
|
||||
.LINK
|
||||
@ -18,7 +17,6 @@
|
||||
|
||||
" "
|
||||
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
|
||||
& "$PSScriptRoot/check-bios.ps1"
|
||||
& "$PSScriptRoot/check-os.ps1"
|
||||
& "$PSScriptRoot/check-uptime.ps1"
|
||||
& "$PSScriptRoot/check-apps.ps1"
|
||||
|
@ -5,7 +5,7 @@
|
||||
This PowerShell script queries the computer's uptime (time between now and last boot up time) and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-uptime.ps1
|
||||
✅ Up for 2 days, 20 hours, 10 minutes
|
||||
✅ OfficePC is up for 13 days since 1/25/2024
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -26,14 +26,15 @@ function TimeSpan2String([TimeSpan]$uptime)
|
||||
}
|
||||
|
||||
try {
|
||||
$hostname = $(hostname)
|
||||
if ($IsLinux) {
|
||||
$uptime = (Get-Uptime)
|
||||
Write-Host "✅ Up for $(TimeSpan2String $uptime)"
|
||||
Write-Host "✅ $hostname is up for $(TimeSpan2String $uptime)"
|
||||
} else {
|
||||
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
|
||||
$lastBootTime = (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
|
||||
$uptime = New-TimeSpan -Start $lastBootTime -End (Get-Date)
|
||||
Write-Host "✅ Up for $(TimeSpan2String $uptime) since $($lastBootTime.ToShortDateString())"
|
||||
Write-Host "✅ $hostname is up for $(TimeSpan2String $uptime) since $($lastBootTime.ToShortDateString())"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
@ -1,8 +1,8 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Executes tasks on desktop login
|
||||
Executes tasks on every desktop login
|
||||
.DESCRIPTION
|
||||
This PowerShell script executes some 'welcome' tasks on desktop login by the user.
|
||||
This PowerShell script executes some 'welcome' tasks on every desktop login by the user.
|
||||
NOTE: For installation on Windows create and put a symbolic link to this script into the Autostart folder (usually at: C:\Users\<USERNAME>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup).
|
||||
.EXAMPLE
|
||||
PS> ./on-desktop-login.ps1
|
||||
@ -16,10 +16,11 @@ try {
|
||||
& "$PSScriptRoot/write-big.ps1" "Welcome back"
|
||||
" "
|
||||
& "$PSScriptRoot/check-uptime.ps1"
|
||||
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||
& "$PSScriptRoot/check-firewall.ps1"
|
||||
& "$PSScriptRoot/check-smart-devices.ps1"
|
||||
& "$PSScriptRoot/check-swap-space.ps1"
|
||||
& "$PSScriptRoot/check-drives.ps1"
|
||||
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||
& "$PSScriptRoot/open-dashboards.ps1"
|
||||
" "
|
||||
& "$PSScriptRoot/write-quote.ps1"
|
||||
|
Loading…
Reference in New Issue
Block a user