Войти

Показать полную графическую версию : Управление компьютерами в AD ч. 2


Страниц : 1 [2]

Неадекват
04-12-2014, 15:11
Kazun, тысяча извинений, но я действительно не понял сперва ваше сообщение. Потом гугл мне подсказал и я понял что надо сделать.

Неадекват
04-12-2014, 16:04
А теперь другая проблема - как заставить сценарий игнорировать ошибки? Я дописал в конце команду, которую нагуглил...

-PassThru -ea Continue | Out-GridView

...но все равно ошибки появляются плюс окно от команды Out-GridView не появляется. Т.е. непонятно это потому что нечего выводить или потому что ошибки?

Iska
04-12-2014, 17:34
...но все равно ошибки появляются »
Разумеется. about_CommonParameters (http://technet.microsoft.com/en-us/library/hh847884.aspx):
-ErrorAction[:{Continue | Ignore | Inquire | SilentlyContinue | Stop |
Suspend }]
Alias: ea

Determines how the cmdlet responds to a non-terminating error
from the command. This parameter works only when the command generates
a non-terminating error, such as those from the Write-Error cmdlet.

The ErrorAction parameter overrides the value of the
$ErrorActionPreference variable for the current command.
Because the default value of the $ErrorActionPreference variable
is Continue, error messages are displayed and execution continues
unless you use the ErrorAction parameter.

The ErrorAction parameter has no effect on terminating errors (such as
missing data, parameters that are not valid, or insufficient
permissions) that prevent a command from completing successfully.

Valid values:

Continue. Displays the error message and continues executing
the command. "Continue" is the default value.

Ignore. Suppresses the error message and continues
executing the command. Unlike SilentlyContinue, Ignore
does not add the error message to the $Error automatic
variable. The Ignore value is introduced in Windows
PowerShell 3.0.

Inquire. Displays the error message and prompts you for
confirmation before continuing execution. This value is rarely
used.

SilentlyContinue. Suppresses the error message and continues
executing the command.

Stop. Displays the error message and stops executing the
command.

Suspend. This value is only available in Windows PowerShell workflows.
When a workflow runs into terminating error, this action preference
automatically suspends the job to allow for further investigation. After
investigation, the workflow can be resumed.

Неадекват
04-12-2014, 17:38
Iska, гм... Ну ладно, с появлением ошибок понятно. Но почему последний командлет не выполняется и ничего такого ISE не говорит - вот это мне непонятно.




© OSzone.net 2001-2012