Skip to content
Steve Perry edited this page Nov 22, 2015 · 1 revision

View the source code

Run:

hello-world.ps1

Demonstrates declaring and manipulating variables.

Variable names begin with a dollar sign.

Varaibles are objects (I think), so you can call their methods and get their properties.

Here's an instance of the Int32 structure:

$n = 5
$n.GetTypeCode()
Int32

$n.Equals(6)
False

Here's an instance of the String clsss:

$s = "Steve"
$s.Length
5

Here's an instance of the Double structure:

8.3.GetTypeCode()
Double

Notes

Constants aqre objects too (I think).

"Edward".Length
6

(5).GetTypeCode()
Int32

References

Scripting with Windows Powershell

Clone this wiki locally