-
constants, use of variables
Operations on various strings
Operations on operators
arrays, hash tables: creating, modifying merged arrays and hash tables
Conditional judgment:If, switch statement
Logical judgment: Using operators to judge
loop control:while, Do...while, do ... until, For,foreach statements
Modular: organize and adjust code; Use the exact data type to invoke other script functions
WMI object:
The WMI namespace concept,WMI provides the functionality to view and use the WMI namespace.
WMI class:get-wmiobject; Enquiry Wmi
ADSI Object
the concept of Active Directory objects;
the functionality that ADSI provides;
Active Directory namespace;
Create and modify ActiveDirectory Object
Reference: http://marui.blog.51cto.com/1034148/291383
Assignment of variables:
$STR = "123"
or set-variable-name str–value "123"
when declaring variables, avoid some "system reserved words", such as:
Break | Continue | do | else | ElseIf |filter | foreach | function | If | In | return | Switch | Until | where | While
Output variables
Write-output $str
or enter $STR directly
Hashtable : Hash Table
BOOL : true , false
XML : XML Object
Array : Array
decimal : decimal number, 128bit
byte : unsigned characters, 8bit
Char : Unicode encoded characters, 16bit
string : Unicode encoded string
Single : Single Precision 32bit floating point
Double : Double Precision 64bit floating point
Long : Signed, 64bit
int: There are symbols, 32bit
$strA = "Hello" <enter>
$strB = "world!" <enter>
$strC = $strA + $strB <enter>
$strC <enter> Results: "Hello world!"
String substitution:
$strA = "hi! world! "<enter>
$strB = $strA-replace "hi!", "Hello" <enter>
$strB <enter> Results: "hi!,world!"
String reference:
$strA = "ABC" <enter>
"This is $strA." <enter> Results: "Thisis ABC"
' This is $strA. ' <enter> Results: "This is $strA"
PowerShell operator operation (+,-, *,/,%,=,++,-- )
5 + <enter>
$x =200+1 <enter>
$x <enter>
[int] $y = (7 + * 2)/10<enter>
$y <enter> Results: 3
Reference: http://marui.blog.51cto.com/1034148/291383
This article comes from the "Ricky's blog" blog, please be sure to keep this source http://57388.blog.51cto.com/47388/1639140
8. PowerShell-Basic overview, variables, character and string manipulation, operator operations