Difference between revisions of "Power Shell"

Jump to navigation Jump to search
1,086 bytes added ,  08:07, 23 December 2009
m
Added "Variables"
m (Added "Variables")
Line 1: Line 1:
* [http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx Windows PowerShell V1]
* [http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx Windows PowerShell V1]
* [http://support.microsoft.com/kb/968929 Windows PowerShell V2]
* [http://support.microsoft.com/kb/968929 Windows PowerShell V2]
== Variables ==
Powershell is all about manipulating objects, and its variables are all essentially the same, not being specifically defined as an object, string, integer, etc. Which is normally useful, however sometimes you need to force a variable to contain a data type. Using a prefix of [type] achieves this...
* <code> [string]$result = $PingResult.Status </code>
{|cellpadding="1" cellspacing="0" border="1"
|- style="background-color:#bbddff;"
! Notation                      !! Data Type
|-
|<code> [datetime] </code>      || Date or time
|-
|<code> [string] </code> || String of characters
|-
|<code> [char]  </code> || Single character
|-
|<code> [double] </code> || Double-precision floating number
|-
|<code> [single] </code> || Single-precision floating number
|-
|<code> [int] </code> || 32-bit integer
|-
|<code> [wmi] </code> || Windows Management Instrumentation (WMI) instance or collection
|-
|<code> [adsi] </code> || Active Directory Services object
|-
|<code> [wmiclass] </code> || WMI class
|-
|<code> [Boolean] </code> || True or False value
|}


== Credentials ==
== Credentials ==

Navigation menu