Beginning Programming With Powershell Cheat Sheet Page 2

ADVERTISEMENT

More:
-ErrorAction
Determine how errors are handled, e.g. silentlycontinue, Stop, Continue,
Ignore, Inquire
-ErrorVariable
Create an error variable for use later, e.g. -errorvariable +err
$err
Param()
Create parameters, so you can pass values into the script.
Example: param ([string]$FilePath)
function
Create functions to componetize your code.
fname($var) {}
fname $var
Function call.
. .\IncludeFile.ps1;
Dot-source include a file, so it runs as part of your script.
References
Us:
Twitter.com\KenpoDBA
Twitter.com\MidnightDBA
MinionWare.net
Powershell documentation on Microsoft.com:
us/powershell/scripting/powershell-scripting

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2