Skip to content

Latest commit

 

History

History
108 lines (83 loc) · 2.52 KB

command.md

File metadata and controls

108 lines (83 loc) · 2.52 KB
description ms.date ms.topic title
Command line reference for the 'dsc completer' command
01/17/2024
reference
dsc completer

dsc completer

Synopsis

Generates a shell completion script.

Syntax

dsc completer [Options] <SHELL>

Description

The completer command returns a shell script that, when executed, registers completions for the given shell. DSC can generate completion scripts for the following shells:

The output for this command is the script itself. To register completions for DSC, execute the script.

Warning

Always review scripts before executing them, especially in an elevated execution context.

Examples

Example 1 - Register completions for Bash

completer=~/dsc_completion.bash
# Export the completion script
dsc completer bash > $completer
# Review the completion script
cat $completer
# Add the completion script to your profile
echo "source $completer" >> ~/.bashrc
# Execute the completion script to register completions for this session
source $completer

Example 2 - Register completions for PowerShell

$Completer = '~/dsc_completion.ps1'
# Export the completion script
dsc completer powershell | Out-File $Completer
# Review the completion script
Get-Content $completer
# Add the completion script to your profile
Add-Content -Path $PROFILE ". $Completer"
# Execute the completion script to register completions for this session
. $Completer

Arguments

SHELL

This argument is mandatory for the completer command. The value for this option determines which shell the application returns a completion script for:

Type:        String
Mandatory:   true
ValidValues: [
               bash,
               elvish,
               fish,
               powershell,
               zsh,
             ]

Options

-h, --help

Displays the help for the current command or subcommand. When you specify this option, the application ignores all options and arguments after this one.

Type:      Boolean
Mandatory: false