Rename to list-city-weather.ps1

This commit is contained in:
Markus Fleschutz
2021-04-18 11:39:32 +02:00
parent fbad5259f7
commit e273ec2d9e
5 changed files with 9 additions and 19 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/pwsh
#!/usr/bin/pwsh
<#
.SYNTAX weather-worldwide.ps1
.DESCRIPTION prints the current weather of cities world-wide
.SYNTAX list-city-weather.ps1
.DESCRIPTION list the current weather of cities world-wide (west to east)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
@ -9,14 +9,10 @@
$Cities="Hawaii","Los Angeles","Mexico City","Miami","New York","Rio de Janeiro","Paris","London","Berlin","Cape Town","Dubai","Mumbai","Singapore","Hong Kong","Peking","Tokyo","Sydney"
try {
write-output "Current Weather Report World-wide"
write-output "================================="
write-output ""
foreach($City in $Cities) {
$Line = (Invoke-WebRequest http://wttr.in/${City}?format="%l:+%c+%t+%p+%h+%P+%w +%S ->+%s" -UserAgent "curl").Content
write-output "* $Line"
$Line = (Invoke-WebRequest http://wttr.in/${City}?format="%c %l+%t+%p+%h+%P+%w +%S +%s" -UserAgent "curl").Content
"$Line"
}
write-output ""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -9,8 +9,7 @@
if ($IsLinux) { $Username = $(whoami) } else { $Username = $env:USERNAME }
$Hostname = $(hostname)
$host.ui.RawUI.WindowTitle = "$Username @ $Hostname"
write-host "🧑 $Username enters PowerShell $($PSVersionTable.PSVersion) at $Hostname in $(Get-Location)"
write-host ""
"🧑 $Username enters 💻$Hostname at $(Get-Location)"
# My Command Prompt
@ -26,8 +25,4 @@ function prompt { "`n💲 " } # result is: 💲
# --------------
set-alias -name cwd -value list-workdir.ps1 # cwd = current working directory
set-alias -name ll -value get-childitem # ll = list long
set-alias -name lsf -value list-formatted.ps1 # lsf = list directory formatted
set-alias -name lsf -value list-formatted.ps1 # lsf = list directory formatted

View File

@ -13,7 +13,6 @@ try {
copy-item "$PathToRepo/Scripts/my-profile.ps1" "$PathToProfile" -force
"✔️ PowerShell profile 'CurrentUserCurrentHost' updated by my-profile.ps1 - it gets active on next login"
""
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"