Please wait,
Processing your request...

  Business logo mourning
  ... | Selecteer de Nederlandse taal | Print this page. | Linkedin page of Johan van Soest | User: Guest | Login

Postcard image. Click this to mail to Johan


ICT-Hotlist Topic

Back to the ICT-Hotlist...
Don't miss latest updates Follow @WebHalla

PowerShell script example: HelloWorld.ps1

This is the HelloWorld.ps1 PowerShell script example.
# This PowerShell script HelloWorld.ps1 is designed merely to provide an
# example script for the demonstration on how to enable the running of
# scripts in the Windows PowerShell environment.
# (C) Copyright 2013 - 2020 Johan van Soest. []
# Version 1.0 03-10-2013 by Johan van Soest

# Get the hour from the current date

$Hour= ( Get-Date ).Hour

# Select the day phase from the time using the if, elseif, compare and -and
# statements.

if ($Hour -lt 7 ) {$Output = "night"}
elseif (($Hour -gt 6 ) -and ($Hour -lt 12 )) {$Output= "morning"}
elseif (($Hour -gt 11 ) -and ($Hour -lt 18 )) {$Output= "afternoon"}
elseif ($Hour -gt 17 ) {$Output= "evening"}

# We know now what to write. Write it to the console.
Write-Output "Hello World,"
Write-Output " ?Johan van Soest wishes you : Good $Output!"
You may vote your opinion about this article:

Scripts and programming examples disclaimer

Unless stated otherwise, the script sources and programming examples provided are copyrighted freeware. You may modify them, as long as a reference to the original code and hyperlink to the source page is included in the modified code and documentation. However, it is not allowed to publish (copies of) scripts and programming examples on your own site, blog, vlog, or distribute them on paper or any other medium, without prior written consent.
Many of the techniques used in these scripts, including but not limited to modifying the registry or system files and settings, impose a risk of rendering the Operating System inoperable and loss of data. Make sure you have verified full backups and the associated restore software available before running any script or programming example. Use these scripts and programming examples entirely at your own risk. All liability claims against the author in relation to material or non-material losses caused by the use, misuse or non-use of the information provided, or the use of incorrect or incomplete information, are excluded. All content is subject to change and provided without obligation.
Generated by WebHalla™ Version 0.1.e.5 : Saturday 31-10-2020 © Copyright 1995-2020 ing. Johan P.G. van Soest CIPM Certified Privacy Information Manager
Response Form    Cookie- and Privacy statement
Weather in Waalre by OpenWeatherMap logo overcast clouds
Temperature 13.01 °C overcast clouds
Wind chill 11.43 °C overcast clouds
Humidity 93 % overcast clouds
Air pressure 1022 hPa overcast clouds
Wind speed 3.1 m/s overcast clouds
Wind direction South South overcast clouds
Sun Rise 7:30 Sun Rise
Sun Set 17:13 Sun Set
Updated:2020-10-31 05:58:44 overcast clouds

Weather Cache is 6 minute(s) old.