A.5. Global
|
|
Variable |
Value |
|---|---|
|
$home |
User's home directory |
|
$host |
Information about the MSH runtime |
|
$mshhome |
Path of currently running msh.exe |
|
$pid |
Process ID of current msh.exe process |
|
$pwd |
Current working directory |
A.6. Preference
|
|
Variable |
Meaning |
|---|---|
|
$ConfirmPreference |
Defines the default -Confirm setting |
|
$DebugPreference |
Defines the default -Debug setting |
|
$ErrorActionPreference |
Defines the default -ErrorAction setting |
|
$VerbosePreference |
Defines the default -Verbose setting |
|
$WhatIfPreference |
Defines the default -WhatIf setting |
A.7. Execution FlowMSH offers two mechanisms for controlling the flow of script execution: the if statement and the switch statement. A.7.1. if Statement
if (
<test 1>
) {
<block 1>
}
elseif (
<test2>
) {
<block 2>
}
...
else {
<block 3>
}
As soon as one of the tests
A.7.2. switch Statement
switch (
<expression>
)
{
<value>
{
<block 1>
} # case 1
{
<test>
} {
<block 2>
} # case 2
default {
<block 3>
} # case 3
}
In case 1, MSH
|
A.8.
|