mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-17 02:01:01 +01:00
Add say-operating-system.ps1
This commit is contained in:
parent
848c7b13a9
commit
50139d55d0
29
Scripts/say-operating-system.ps1
Executable file
29
Scripts/say-operating-system.ps1
Executable file
@ -0,0 +1,29 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Say the operating system details by text-to-speech
|
||||
.DESCRIPTION
|
||||
This script speaks the operating system details by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./say-operating-system
|
||||
(listen)
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
$details = (uname -sr)
|
||||
} else {
|
||||
$OSname = Get-WmiObject -class Win32_OperatingSystem
|
||||
$OSarchitecture = $OS.OSArchitecture
|
||||
$OSversion = $OS.Version
|
||||
$details = "$OSname for $OSarchitecture version $OSversion"
|
||||
}
|
||||
& "$PSScriptRoot/speak-english.ps1" "$details"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user