mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 09:50:02 +01:00
Removed emojis from Write-Progress messages
This commit is contained in:
parent
8ccc88cc35
commit
106cda4f53
@ -14,13 +14,13 @@
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
Write-Progress "⏳ Querying installed applications..."
|
||||
Write-Progress "Querying installed applications..."
|
||||
$numPkgs = (apt list --installed 2>/dev/null).Count
|
||||
$numSnaps = (snap list).Count - 1
|
||||
Write-Progress -Completed "."
|
||||
Write-Host "✅ $numPkgs Debian packages, $numSnaps snaps installed"
|
||||
} else {
|
||||
Write-Progress "⏳ Querying installed applications..."
|
||||
Write-Progress "Querying installed applications..."
|
||||
$Apps = Get-AppxPackage
|
||||
Write-Progress -Completed "."
|
||||
Write-Host "✅ $($Apps.Count) Windows apps installed, " -noNewline
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
Write-Progress "⏳ Querying BIOS details..."
|
||||
Write-Progress "Querying BIOS details..."
|
||||
$model = (sudo dmidecode -s system-product-name)
|
||||
if ("$model" -ne "") {
|
||||
$version = (sudo dmidecode -s bios-version)
|
||||
|
@ -44,7 +44,7 @@ function GetProcessorArchitecture {
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Querying CPU status... "
|
||||
Write-Progress "Querying CPU status... "
|
||||
$status = "✅"
|
||||
$celsius = GetProcessorTemperature
|
||||
if ($celsius -eq 99999.9) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Measuring DNS resolution..."
|
||||
Write-Progress "Measuring DNS resolution..."
|
||||
$table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv"
|
||||
$numRows = $table.Length
|
||||
|
||||
|
@ -32,10 +32,10 @@ function Bytes2String { param([int64]$bytes)
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Querying drives..."
|
||||
Write-Progress "Querying drives..."
|
||||
$drives = Get-PSDrive -PSProvider FileSystem
|
||||
$minLevel *= 1000 * 1000 * 1000
|
||||
Write-Progress -completed "."
|
||||
Write-Progress -completed " "
|
||||
foreach($drive in $drives) {
|
||||
$details = (Get-PSDrive $drive.Name)
|
||||
if ($IsLinux) { $name = $drive.Name } else { $name = $drive.Name + ":" }
|
||||
|
@ -29,11 +29,11 @@ function Bytes2String { param([int64]$Bytes)
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ (1/3) Searching for smartmontools..."
|
||||
Write-Progress "(1/3) Searching for smartmontools..."
|
||||
$Result = (smartctl --version)
|
||||
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) {
|
||||
$Devices = $(sudo smartctl --scan-open)
|
||||
} else {
|
||||
@ -41,7 +41,7 @@ try {
|
||||
}
|
||||
|
||||
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(" ")
|
||||
$Device = $Array[0]
|
||||
if ("$Device" -eq "#") {
|
||||
|
@ -19,7 +19,7 @@ param([string]$path = "")
|
||||
try {
|
||||
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()
|
||||
$path = Resolve-Path "$path"
|
||||
|
||||
@ -37,4 +37,4 @@ try {
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ function WriteHorizontalBar { param([float]$Value, [float]$Max)
|
||||
}
|
||||
|
||||
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
|
||||
Write-Progress -completed " "
|
||||
|
||||
|
@ -21,22 +21,22 @@
|
||||
param([string]$path = "$PWD")
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ (1/4) Searching for Git executable..."
|
||||
Write-Progress "(1/4) Searching for Git executable..."
|
||||
$null = (git --version)
|
||||
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" }
|
||||
|
||||
Write-Progress "⏳ (3/4) Fetching updates..."
|
||||
Write-Progress "(3/4) Fetching updates..."
|
||||
& git -C "$path" fetch --all --quiet
|
||||
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"
|
||||
"------- ------"
|
||||
Write-Progress -completed " "
|
||||
Write-Progress -completed "Done."
|
||||
git -C "$path" shortlog --summary --numbered --email --no-merges
|
||||
if ($lastExitCode -ne "0") { throw "'git shortlog' failed with exit code $lastExitCode" }
|
||||
exit 0 # success
|
||||
|
@ -28,10 +28,10 @@ try {
|
||||
$Null = (git --version)
|
||||
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
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||
Write-Progress -Completed " "
|
||||
Write-Progress -Completed "Done."
|
||||
|
||||
if ($Format -eq "pretty") {
|
||||
""
|
||||
|
@ -16,27 +16,26 @@
|
||||
param([string]$RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ (1/3) Searching for Git executable... "
|
||||
Write-Progress "(1/3) Searching for Git executable... "
|
||||
$null = (git --version)
|
||||
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" }
|
||||
$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
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch --all' failed with exit code $lastExitCode" }
|
||||
Write-Progress -completed " "
|
||||
Write-Progress -completed "Done."
|
||||
|
||||
" "
|
||||
"Commit ID Reference"
|
||||
"--------- ---------"
|
||||
& git -C "$RepoDir" ls-remote origin 'pull/*/head'
|
||||
if ($lastExitCode -ne "0") { throw "'git ls-remote' failed with exit code $lastExitCode" }
|
||||
Write-Progress -completed " "
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
@ -23,18 +23,18 @@
|
||||
param([string]$RepoDir = "$PWD", [string]$SearchPattern="*")
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ (1/4) Searching for Git executable... "
|
||||
Write-Progress "(1/4) Searching for Git executable... "
|
||||
$Null = (git --version)
|
||||
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" }
|
||||
|
||||
Write-Progress "⏳ (3/4) Fetching newer tags from remote..."
|
||||
Write-Progress "(3/4) Fetching newer tags from remote..."
|
||||
& git -C "$RepoDir" fetch --all --tags
|
||||
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
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch --prune --prune-tags' failed" }
|
||||
|
||||
|
@ -25,10 +25,10 @@ try {
|
||||
"⏳ (2/2) Querying Snap updates..."
|
||||
& sudo snap refresh --list
|
||||
} 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
|
||||
Write-Progress -completed " "
|
||||
Write-Progress -completed "Done."
|
||||
}
|
||||
" (use 'install-updates.ps1' to install the listed updates)"
|
||||
exit 0 # success
|
||||
|
@ -81,7 +81,7 @@ function GetWindDir { param([string]$Text)
|
||||
}
|
||||
|
||||
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
|
||||
Write-Progress -completed "."
|
||||
$Area = $Weather.nearest_area.areaName.value
|
||||
|
@ -14,10 +14,10 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Reading Data/popular-dashboards.csv..."
|
||||
Write-Progress "Reading Data/popular-dashboards.csv..."
|
||||
$table = Import-CSV "$PSScriptRoot/../Data/popular-dashboards.csv"
|
||||
$numRows = $table.Length
|
||||
Write-Progress -completed "."
|
||||
Write-Progress -completed " "
|
||||
Write-Host "✅ Launching Web browser with 20 tabs showing: " -noNewline
|
||||
foreach($row in $table) {
|
||||
Write-Host "$($row.NAME), " -noNewline
|
||||
@ -29,4 +29,4 @@ try {
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
@ -23,22 +23,22 @@ param([string]$RepoDir = "$PWD")
|
||||
try {
|
||||
[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)
|
||||
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" }
|
||||
$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
|
||||
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)
|
||||
|
||||
Write-Progress "⏳ (5/6) Sorting the Git commit messages..."
|
||||
Write-Progress "(5/6) Sorting the Git commit messages..."
|
||||
$new = @()
|
||||
$fixes = @()
|
||||
$updates = @()
|
||||
@ -61,7 +61,7 @@ try {
|
||||
$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)
|
||||
Write-Progress -completed " "
|
||||
|
||||
@ -103,4 +103,4 @@ try {
|
||||
} catch {
|
||||
Write-Error $_.Exception.ToString()
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user