Saturday, May 28, 2011

Hello-World

Hello World...  The perfect sample app.

In PS you can do this a multitude of ways:
echo "Hello World"
Write-Output "Hello World"
# Echo and Write-Output are actually the same command.
#or just
"Hello World"
#or
("{0} {1}" -f "Hello","World")
# or Call .Net WinForms
Function HelloForm {
    [void][System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")
    $form = New-Object System.Windows.Forms.Form
    $form.Text="Hello World"
    $form.ShowDialog()
}
HelloForm

No comments:

Post a Comment