Skip to content

Latest commit

 

History

History
72 lines (56 loc) · 3.41 KB

VSCodeExtension.md

File metadata and controls

72 lines (56 loc) · 3.41 KB
external help file Module Name ms.date online version schema title
Microsoft.VSCode.Dsc.psm1-Help.xml
Microsoft.VSCode.Dsc
10/22/2024
2.0.0
VSCodeExtension

VSCodeExtension

SYNOPSIS

Manages Visual Studio Code extensions using DSC.

DESCRIPTION

The VSCodeExtension DSC Resource allows you to install, update, and remove Visual Studio Code extensions. This resource ensures that the specified Visual Studio Code extension is in the desired state.

PARAMETERS

Parameter Attribute DataType Description Allowed Values
Name Key String The name of the Visual Studio Code extension to manage. To find extensions in VSCode, check out: https://code.visualstudio.com/docs/editor/extension-marketplace#_find-and-install-an-extension
Version Optional String The version of the Visual Studio Code extension to install. If not specified, the latest version will be installed. For example: 1.0.0
Exist Optional Boolean Indicates whether the extension should exist. The default value is $true. $true, $false
Insiders Optional Boolean Indicates whether to manage the extension for the Insiders version of Visual Studio Code. The default value is $false. $true, $false

EXAMPLES

EXAMPLE 1

# Install the latest version of the Visual Studio Code extension 'ms-python.python'
$params = @{
    Name = 'ms-python.python'
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc

EXAMPLE 2

# Install a specific version of the Visual Studio Code extension 'ms-python.python'
$params = @{
    Name = 'ms-python.python'
    Version = '2021.5.842923320'
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc

EXAMPLE 3

# Ensure the Visual Studio Code extension 'ms-python.python' is removed
$params = @{
    Name = 'ms-python.python'
    Exist = $false
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc

EXAMPLE 4

# Ensure the Visual Studio Code extension 'ms-python.python' is removed
$params = @{
    Name = 'ms-python.python'
    Insiders = $true
}
Invoke-DscResource -Name VSCodeExtension -Method Set -Property $params -ModuleName Microsoft.VSCode.Dsc