3.13 Using CLI Commands in Scripts

When you use Dynamic File Services commands in scripts, you can use the -silent option to prevent the results from displaying to a console. The script should check for an exit code to report whether a command succeeded or failed. The -silent option can be added to any pair or policy command.

-silent

Use this option when you do not want to display errors or help on execution, such as in scripts for batch files where the batch file checks for exit codes.

If a command fails, you can enter the command at the Administrator Command Prompt console without the ‑silent option to view the error messages.

Syntax

DswCli.exe [authentication_parameters] -pair 
         -silent 
         [pair_actions]  
         [pair_parameters] 
         [pair_options]
DswCli.exe [authentication_parameters] -policy 
         -silent 
         [policy_actions]  
         [policy_parameters] 
         [policy_options]

For information about the Dynamic File Services command options, see the following resources:

Option

Reference

authentication_parameters

Section 3.3, Authentication Parameters

  • -pair
  • pair_actions
  • pair_parameters
  • pair_options

Section 3.8, Pair Actions

  • -policy
  • policy_actions
  • policy_parameters
  • policy_options

Section 3.9, Policy Actions

Exit Codes

The DswCli.exe command returns an exit code of 0 for success or 1 for failure.