Академический Документы
Профессиональный Документы
Культура Документы
. Windows PowerShell
, string, int (32-
), long (64- ), bool (
), byte, Microsoft .NET.
,
.
, ,
(=).
, $A,
( int), 22, 5, 10, 8, 12, 9 80,
:
$A = 22,5,10,8,12,9,80
,
(..). ,
"$B", 5 8,
:
$B = 5..8
$B : 5, 6, 7 8.
, Windows PowerShell
(: object[]).
GetType(). ,
$a, :
$a.gettype()
, ,
,
, , string[], long[] int32[].
,
. ,
32- $ia,
(1500, 2230, 3350 4000), :
[int32[]]$ia = 1500,2230,3350,4000
, $ia
.
, ,
Microsoft .NET. , ,
Get-Process ,
System.Diagnostics.Process.
, :
[Diagnostics.Process[]]$zz = Get-Process
, . ,
,
, "co".
,
$LocalProcesses .
,
(@), :
,
$LocalProcesses .
,
. , .
. about_Operators.
,
, $A $a. Windows PowerShell
.
, . :
$a
, 0. .
, $a,
:
$a[0]
$a, :
$a[2]
.
, "-1" .
, :
$a[-3..-1]
$a[0..-2]
.
,
.
,
. ,
1 3, :
$a[1..3]
, "+". ,
0, 2, 4 6,
:
$a[0,2+4..6]
,
lentgh. ,
2 , :
$a[2..($a.length-1)]
,
0. (1, 2 3)
2, ,
.
, , Foreach, For While. ,
Foreach $a,
:
Foreach
, .
For
. ,
For, :
While
, . ,
$a, 4,
:
$i=0
while($i -lt 4) {$a[$i]; $i++}
, ,
Length SetValue, InputObject
Get-Member.
Get-Member ,
. InputObject
.
$a
:
get-member -inputobject $a
, ,
.
,
, ,
(=),
. , 10
$a ( 1), :
$a[1] = 10
,
SetValue. $a ( 1)
500:
$a.SetValue(500,1)
"+=".
.
, .
,
. ,
200 $a, :
$a += 200
,
,
. , $t,
$a 2,
:
, "+".
; ,
:
$x = 1,3
$y = 5,9
$z = $x + $y
$z 1, 3, 5 9.
, Remove-Item
, .
"a" Variable:.
remove-item variable:a
( Variable:,
. " Variable".)
.
about_Assignment_Operators
about_Hash_Tables
about_Operators
about_For
about_Foreach
about_While