New
#70
I'll just stick with Good Morning y'all! And if there's more than one of ya, Good Morning all y'all!
:)
I'll just stick with Good Morning y'all! And if there's more than one of ya, Good Morning all y'all!
:)
Nice!
Here's my default PS script. Somewhat shorter but does the same:
Code:$Hour = Get-Date -Format "HH:mm" $Now = Get-Date -Format "HH:mm (h:mm tt)" If ($Hour -lt "06:00") {Write-Host "It's quite late" $env:username". The time is "$Now} ElseIf ($Hour -lt "12:00") {Write-Host "Good morning" $env:username". The time is "$Now} ElseIf ($Hour -lt "18:00") {Write-Host "Good afternoon" $env:username". The time is "$Now} ElseIf ($Hour -ge "18:00") {Write-Host "Good evening" $env:username". The time is "$Now} Write-Host Set-Location $env:USERPROFILE
Yeah, I don't like to do string comparisons, I'd rather work with objects until I need to spit something out to the console. Easy to make mistakes in code when having to use literal strings, no IDE can help check the type and correctness of the value then.
I just realized I use "magic numbers", those are bad too, will move those to variables too.
I must be totally honest: I know these last posts have been way off topic. However, as no new builds have been released and it's quiet, I like this, tossing ideas around and keep conversation going on :)
Have to go now, MRI scan at neurological clinic at Hospital of University of Leipzig awaiting...
I don't mind, I am learning.
And though I was born and raised in the US, my parents are from India, so I have a bit of training in speaking and reading Hindi. So, for those of you that are complaining about (er, making the case for the complicated nature of) their native tongue(s), I feel your pain.
As for the greeting in PS, Kari, way back in the day there was a nice menu system made for DOS that involved a lot of escape sequences to keep things like the current date and time and other text you wanted at the top line of the screen, in addition to modifying the command prompt to show whatever you wanted. I am going to see if I can find that to give me a nice little starting point to take on your challenge for this PS getting....
Here's a PowerShell challenge for you guys!
Recreate this Sudoku game, I wrote in C# for console years back, using only PowerShell:
EDIT: As this is way off topic, Moderators feel free to move this post to a new topic in an appropriate location.
I will challenge myself to rewrite this UUP thingie using PS. Making easy to import modules that the user just run from anywhere in the shell for conversion.
I am Finnish too, but my surname is not Finnish ;-)