PowerShell - cuni.cz

PowerShell

Windows scripting

25.04.2019

vjj

1

? Verb-Noun

Cmdlets

? alias

? parametry mohou b?t kl?cov? i pozicn?

Verb-Noun ?Parm1 V1 ?Parm2 V2, V3 ?Parm4:V4

? wildcards

? ne?pln? jm?na parametr (jednoznacnost)

25.04.2019

vjj

2

alias

Set-Alias fldr Get-ChildItem fldr . -Include *.ps1 -Recurse fldr . -Inc *.ps1 -Rec

Set-Location Get?Cwd Get?Content New?item ?type directory Get?ChildItem

cd cd type mkdir dir

25.04.2019

vjj

cd pwd cat mkdir ls

3

jazyk

? promnn?:

$id = value

? case insensitivity ? certain .NET APIs will be case sensitive

? No errors for data references that do not exist

? koment?:

> p?kaz # koment?

? v?ce?dkov? koment?:

25.04.2019

vjj

4

$_ $^ $$ $? $Args $Switch $Input $Foreach $Matches $Home

$Host $PSHome $profile $StackTrace $LastExitCode $Error

PowerShell Variables

Current pipeline object First token of the previous command line Last token of the previous command line Boolean status of the last command Arguments to a script or function Enumerator in a switch statement Enumerator of objects piped to a script Reference to the enumerator in a foreach loop Hash table of matches found with the ?match operator The users home directory; usually set to %HOMEDRIVE%\%HOMEPATH% Reference to the application hosting the PowerShell language The install location of PowerShell The standard profile (may not be present) Last exception caught by PowerShell Exit code of last program or script Array of errors from previous commands

25.04.2019

vjj

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download