Removed emojis from Write-Progress messages

This commit is contained in:
Markus Fleschutz 2023-10-27 12:06:06 +02:00
parent 8ccc88cc35
commit 106cda4f53
16 changed files with 42 additions and 43 deletions

View File

@ -14,13 +14,13 @@
try { try {
if ($IsLinux) { if ($IsLinux) {
Write-Progress "Querying installed applications..." Write-Progress "Querying installed applications..."
$numPkgs = (apt list --installed 2>/dev/null).Count $numPkgs = (apt list --installed 2>/dev/null).Count
$numSnaps = (snap list).Count - 1 $numSnaps = (snap list).Count - 1
Write-Progress -Completed "." Write-Progress -Completed "."
Write-Host "$numPkgs Debian packages, $numSnaps snaps installed" Write-Host "$numPkgs Debian packages, $numSnaps snaps installed"
} else { } else {
Write-Progress "Querying installed applications..." Write-Progress "Querying installed applications..."
$Apps = Get-AppxPackage $Apps = Get-AppxPackage
Write-Progress -Completed "." Write-Progress -Completed "."
Write-Host "$($Apps.Count) Windows apps installed, " -noNewline Write-Host "$($Apps.Count) Windows apps installed, " -noNewline

View File

@ -14,7 +14,7 @@
try { try {
if ($IsLinux) { if ($IsLinux) {
Write-Progress "Querying BIOS details..." Write-Progress "Querying BIOS details..."
$model = (sudo dmidecode -s system-product-name) $model = (sudo dmidecode -s system-product-name)
if ("$model" -ne "") { if ("$model" -ne "") {
$version = (sudo dmidecode -s bios-version) $version = (sudo dmidecode -s bios-version)

View File

@ -44,7 +44,7 @@ function GetProcessorArchitecture {
} }
try { try {
Write-Progress "Querying CPU status... " Write-Progress "Querying CPU status... "
$status = "" $status = ""
$celsius = GetProcessorTemperature $celsius = GetProcessorTemperature
if ($celsius -eq 99999.9) { if ($celsius -eq 99999.9) {

View File

@ -13,7 +13,7 @@
#> #>
try { try {
Write-Progress "Measuring DNS resolution..." Write-Progress "Measuring DNS resolution..."
$table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv" $table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv"
$numRows = $table.Length $numRows = $table.Length

View File

@ -32,10 +32,10 @@ function Bytes2String { param([int64]$bytes)
} }
try { try {
Write-Progress "Querying drives..." Write-Progress "Querying drives..."
$drives = Get-PSDrive -PSProvider FileSystem $drives = Get-PSDrive -PSProvider FileSystem
$minLevel *= 1000 * 1000 * 1000 $minLevel *= 1000 * 1000 * 1000
Write-Progress -completed "." Write-Progress -completed " "
foreach($drive in $drives) { foreach($drive in $drives) {
$details = (Get-PSDrive $drive.Name) $details = (Get-PSDrive $drive.Name)
if ($IsLinux) { $name = $drive.Name } else { $name = $drive.Name + ":" } if ($IsLinux) { $name = $drive.Name } else { $name = $drive.Name + ":" }

View File

@ -29,11 +29,11 @@ function Bytes2String { param([int64]$Bytes)
} }
try { try {
Write-Progress "(1/3) Searching for smartmontools..." Write-Progress "(1/3) Searching for smartmontools..."
$Result = (smartctl --version) $Result = (smartctl --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'smartctl' - make sure smartmontools are installed" } if ($lastExitCode -ne "0") { throw "Can't execute 'smartctl' - make sure smartmontools are installed" }
Write-Progress "(2/3) Scanning S.M.A.R.T devices..." Write-Progress "(2/3) Scanning S.M.A.R.T devices..."
if ($IsLinux) { if ($IsLinux) {
$Devices = $(sudo smartctl --scan-open) $Devices = $(sudo smartctl --scan-open)
} else { } else {
@ -41,7 +41,7 @@ try {
} }
foreach($Device in $Devices) { foreach($Device in $Devices) {
Write-Progress "(3/3) Querying S.M.A.R.T devices..." Write-Progress "(3/3) Querying S.M.A.R.T devices..."
$Array = $Device.split(" ") $Array = $Device.split(" ")
$Device = $Array[0] $Device = $Array[0]
if ("$Device" -eq "#") { if ("$Device" -eq "#") {

View File

@ -19,7 +19,7 @@ param([string]$path = "")
try { try {
if ($path -eq "" ) { $path = Read-Host "Enter the path to the directory tree" } if ($path -eq "" ) { $path = Read-Host "Enter the path to the directory tree" }
Write-Progress "Counting lines of code (LOC)..." Write-Progress "Counting lines.."
$stopWatch = [system.diagnostics.stopwatch]::startNew() $stopWatch = [system.diagnostics.stopwatch]::startNew()
$path = Resolve-Path "$path" $path = Resolve-Path "$path"

View File

@ -33,7 +33,7 @@ function WriteHorizontalBar { param([float]$Value, [float]$Max)
} }
try { try {
Write-Progress "Loading data from www.alphavantage.co..." Write-Progress "Loading data from www.alphavantage.co..."
$prices = (Invoke-WebRequest -URI "https://www.alphavantage.co/query?function=COFFEE&interval=monthly&apikey=demo" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json $prices = (Invoke-WebRequest -URI "https://www.alphavantage.co/query?function=COFFEE&interval=monthly&apikey=demo" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
Write-Progress -completed " " Write-Progress -completed " "

View File

@ -21,22 +21,22 @@
param([string]$path = "$PWD") param([string]$path = "$PWD")
try { try {
Write-Progress "(1/4) Searching for Git executable..." Write-Progress "(1/4) Searching for Git executable..."
$null = (git --version) $null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
Write-Progress "(2/4) Checking local Git repository..." Write-Progress "(2/4) Checking local Git repository..."
if (-not(Test-Path "$path" -pathType container)) { throw "Can't access directory: $path" } if (-not(Test-Path "$path" -pathType container)) { throw "Can't access directory: $path" }
Write-Progress "(3/4) Fetching updates..." Write-Progress "(3/4) Fetching updates..."
& git -C "$path" fetch --all --quiet & git -C "$path" fetch --all --quiet
if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" }
Write-Progress "(4/4) Querying commits..." Write-Progress "(4/4) Querying commits..."
" " " "
"Commits Author" "Commits Author"
"------- ------" "------- ------"
Write-Progress -completed " " Write-Progress -completed "Done."
git -C "$path" shortlog --summary --numbered --email --no-merges git -C "$path" shortlog --summary --numbered --email --no-merges
if ($lastExitCode -ne "0") { throw "'git shortlog' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git shortlog' failed with exit code $lastExitCode" }
exit 0 # success exit 0 # success

View File

@ -28,10 +28,10 @@ try {
$Null = (git --version) $Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
Write-Progress "Fetching latest updates..." Write-Progress "Fetching latest updates..."
& git -C "$RepoDir" fetch --all --quiet & git -C "$RepoDir" fetch --all --quiet
if ($lastExitCode -ne "0") { throw "'git fetch' failed" } if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
Write-Progress -Completed " " Write-Progress -Completed "Done."
if ($Format -eq "pretty") { if ($Format -eq "pretty") {
"" ""

View File

@ -16,25 +16,24 @@
param([string]$RepoDir = "$PWD") param([string]$RepoDir = "$PWD")
try { try {
Write-Progress "(1/3) Searching for Git executable... " Write-Progress "(1/3) Searching for Git executable... "
$null = (git --version) $null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
Write-Progress "(2/3) Checking local repository..." Write-Progress "(2/3) Checking local repository..."
if (!(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" } if (!(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" }
$RepoDirName = (Get-Item "$RepoDir").Name $RepoDirName = (Get-Item "$RepoDir").Name
Write-Progress "(3/3) Fetching latest updates..." Write-Progress "(3/3) Fetching latest updates..."
& git -C "$RepoDir" fetch --all --force --quiet & git -C "$RepoDir" fetch --all --force --quiet
if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" }
Write-Progress -completed " " Write-Progress -completed "Done."
" " " "
"Commit ID Reference" "Commit ID Reference"
"--------- ---------" "--------- ---------"
& git -C "$RepoDir" ls-remote origin 'pull/*/head' & git -C "$RepoDir" ls-remote origin 'pull/*/head'
if ($lastExitCode -ne "0") { throw "'git ls-remote' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git ls-remote' failed with exit code $lastExitCode" }
Write-Progress -completed " "
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -23,18 +23,18 @@
param([string]$RepoDir = "$PWD", [string]$SearchPattern="*") param([string]$RepoDir = "$PWD", [string]$SearchPattern="*")
try { try {
Write-Progress "(1/4) Searching for Git executable... " Write-Progress "(1/4) Searching for Git executable... "
$Null = (git --version) $Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
Write-Progress "(2/4) Checking local repository... " Write-Progress "(2/4) Checking local repository... "
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
Write-Progress "(3/4) Fetching newer tags from remote..." Write-Progress "(3/4) Fetching newer tags from remote..."
& git -C "$RepoDir" fetch --all --tags & git -C "$RepoDir" fetch --all --tags
if ($lastExitCode -ne "0") { throw "'git fetch --all --tags' failed" } if ($lastExitCode -ne "0") { throw "'git fetch --all --tags' failed" }
Write-Progress "(4/4) Removing obsolete local tags..." Write-Progress "(4/4) Removing obsolete local tags..."
& git -C "$RepoDir" fetch --prune --prune-tags & git -C "$RepoDir" fetch --prune --prune-tags
if ($lastExitCode -ne "0") { throw "'git fetch --prune --prune-tags' failed" } if ($lastExitCode -ne "0") { throw "'git fetch --prune --prune-tags' failed" }

View File

@ -25,10 +25,10 @@ try {
"⏳ (2/2) Querying Snap updates..." "⏳ (2/2) Querying Snap updates..."
& sudo snap refresh --list & sudo snap refresh --list
} else { } else {
Write-Progress "Querying the latest updates from winget and Microsoft Store..." Write-Progress "Querying the latest updates from winget and Microsoft Store..."
" " " "
& winget upgrade --include-unknown & winget upgrade --include-unknown
Write-Progress -completed " " Write-Progress -completed "Done."
} }
" (use 'install-updates.ps1' to install the listed updates)" " (use 'install-updates.ps1' to install the listed updates)"
exit 0 # success exit 0 # success

View File

@ -81,7 +81,7 @@ function GetWindDir { param([string]$Text)
} }
try { try {
Write-Progress "Loading weather data from http://wttr.in ..." Write-Progress "Loading weather data from http://wttr.in ..."
$Weather = (Invoke-WebRequest -URI http://wttr.in/${Location}?format=j1 -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json $Weather = (Invoke-WebRequest -URI http://wttr.in/${Location}?format=j1 -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
Write-Progress -completed "." Write-Progress -completed "."
$Area = $Weather.nearest_area.areaName.value $Area = $Weather.nearest_area.areaName.value

View File

@ -14,10 +14,10 @@
#> #>
try { try {
Write-Progress "Reading Data/popular-dashboards.csv..." Write-Progress "Reading Data/popular-dashboards.csv..."
$table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv" $table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv"
$numRows = $table.Length $numRows = $table.Length
Write-Progress -completed "." Write-Progress -completed " "
Write-Host "✅ Launching Web browser with 20 tabs showing: " -noNewline Write-Host "✅ Launching Web browser with 20 tabs showing: " -noNewline
foreach($row in $table) { foreach($row in $table) {
Write-Host "$($row.NAME), " -noNewline Write-Host "$($row.NAME), " -noNewline

View File

@ -23,22 +23,22 @@ param([string]$RepoDir = "$PWD")
try { try {
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US" [system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
Write-Progress "(1/6) Searching for Git executable..." Write-Progress "(1/6) Searching for Git executable..."
$null = (git --version) $null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
Write-Progress "(2/6) Checking local repository..." Write-Progress "(2/6) Checking local repository..."
if (!(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" } if (!(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" }
$RepoDirName = (Get-Item "$RepoDir").Name $RepoDirName = (Get-Item "$RepoDir").Name
Write-Progress "(3/6) Fetching the latest commits..." Write-Progress "(3/6) Fetching the latest commits..."
& git -C "$RepoDir" fetch --all --force --quiet & git -C "$RepoDir" fetch --all --force --quiet
if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" } if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" }
Write-Progress "(4/6) Listing all Git commit messages..." Write-Progress "(4/6) Listing all Git commit messages..."
$commits = (git -C "$RepoDir" log --boundary --pretty=oneline --pretty=format:%s | sort -u) $commits = (git -C "$RepoDir" log --boundary --pretty=oneline --pretty=format:%s | sort -u)
Write-Progress "(5/6) Sorting the Git commit messages..." Write-Progress "(5/6) Sorting the Git commit messages..."
$new = @() $new = @()
$fixes = @() $fixes = @()
$updates = @() $updates = @()
@ -61,7 +61,7 @@ try {
$various += $commit $various += $commit
} }
} }
Write-Progress "(6/6) Listing all contributors..." Write-Progress "(6/6) Listing all contributors..."
$contributors = (git -C "$RepoDir" log --format='%aN' | sort -u) $contributors = (git -C "$RepoDir" log --format='%aN' | sort -u)
Write-Progress -completed " " Write-Progress -completed " "